1c# textbox中光标所在行命令及选中命令移动到最后一行且光标提前[转] private void MoveCmdToLast(TextBox txtCmdInput, String selCmd)//把所选中的命令移动到最下一行然后显示在文本框中
  2  

函数调用如下:
        private void txtCmdInput_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                e.SuppressKeyPress = true;    / /回车事件已经处理完不再响应了
                string str = GetCmd(txtCmdInput);
                MoveCmdToLast(txtCmdInput, str);
            }
        }

相关文章: