I've just noticed that DataGridView
s have a default shortcut so that whenever you press Ctrl + H, the DataGridView
's editing control backspaces, and can delete your entire selection within the cell.
This can get quite annoying since I want to open a Replace box whenever Ctrl + H is pressed. Is there any way to stop the backspacing while still being able to use it to open the replace box?
我正在运行 C# 2.0,但如果较新的 C# 有解决方案,我可以将应用程序更新到 3.5。
这进入您的表单代码:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == (Keys.Control | Keys.H))
{
//ShowReplaceDialog() or whatever it is you want to do here.
return true; //we handled the key
}
return base.ProcessCmdKey(ref msg, keyData); //we didn't handle it
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)