In a VB.NET Winforms application, I have a form that contains both a datagridview and a textbox. I have some menu item entries that have shortcuts of Ctrl + X, Ctrl + C, and Ctrl + V that operate on the datagridview. However, these override the default cut, copy, and paste shortcuts for the textbox. How can I make the menu shortcuts only apply when the datagridview has focus?
In a VB.NET Winforms application, I have a form that contains both a datagridview
Share
Proper UI design requires disabling the menu item when it isn’t functional. A side-effect is that it will no longer steal the keystroke, just what you want. The Application.Idle event is handy for that.