I am using MenuStrip in my project in vb.net. I have created two main menus: one is Master and the other is Help. Now anyone press ALT +M then it will open master menu and if press ALT +H then it will open Help menu.
Now I want to prevent this functionality and restrict user to press ALT +[ A KEY ] to open menu.
Can anyone give me an idea to do this?
Set your form’s
KeyPreviewproperty toTrueand test for the key combinations you want to prevent in itsKeyDownevent, then sete.SuppressKeyPress = True.However, I would generally recommend against doing this. People expect to be able to access menus using keyboard shortcuts in Windows applications. Denying them that option makes an application (a) non-compliant with Windows standards, and (b) less user friendly.