set menuitem selected in startup

hamid

Centurion
Joined
Jul 13, 2004
Messages
114
i have a MDI app and i want select firs item of mainMenu at starup application that when user run application he can use mainMenu items by Enter or arrow keys.
i checked PerformSelect() and PerformClick but did not work az i want
 
Hi Hamid,


If you prefix the appropriate letter of the menu with an ampersand you can send the keystrokes to call this menu. For instance, if your menu is File prefix with '&' (&File). The name then appears File.

Now use the following:
System.Windows.Forms.SendKeys.Send("%F")
...to call up the menu. Your cursor should be positioned on the first entry in the list.


Paul.
PS: It's a down and dirty way of doing it, though! ;)
 
Back
Top