日期:2014-05-17 浏览次数:22047 次
protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) { return base.ProcessCmdKey(ref msg, keyData == Keys.Enter ? Keys.Tab : keyData); }
------解决方案--------------------
protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) { //回车换Tab if (keyData == Keys.Enter) { ..... } else base.ProcessCmdKey(.....);
------解决方案--------------------
不但不稳定,不同的操作系统还不执行呢
------解决方案--------------------
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
base.ProcessCmdKey(ref msg, keyData);
int WM_KEYDOWN = 256;
int WM_SYSKEYDOWN = 260;
bool _disable = false;
if (msg.Msg == WM_KEYDOWN || msg.Msg == WM_SYSKEYDOWN)
{
switch (keyData)
{
//重载回车键
case Keys.Enter:
SendKeys.Send("{Tab}");
_disable = true;
break;
}
}
return _disable;
}
------解决方案--------------------
幫頂。。