DataGridView中按回车键时向后移动、可设置在某几列中移动


        protected override bool ProcessCmdKey(ref Message msg, System.Windows.Forms.Keys keyData)
        {
            if (xdgvWorkSignListSave.CurrentCell != null && keyData == Keys.Enter)//如果页面中有多个表格,须指定操作那个
            {
                if (xdgvWorkSignListSave.CurrentCell.ColumnIndex < 1)// 1、为前两列之间移动。
                {
                    SendKeys.Send("{Tab}");
                    return true;
                }

                SendKeys.Send("{Down}");
                SendKeys.Send("{Home}");
                return true;
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

相关文章:

  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
  • 2021-05-18
  • 2021-09-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2021-07-26
  • 2022-02-06
相关资源
相似解决方案