my form contains a menu.
i want some code by which by default when main form is called it should set focus on my menu.
Printable View
my form contains a menu.
i want some code by which by default when main form is called it should set focus on my menu.
Use sendkeys.
Sample: on the File menu make sure you put ampersand like &File. So when you triggered alt + F then it will pop up. Then sendkeys down until you reach a certain item on the menu.
You can use SendKeys "{DOWN 5}" ' press down 5 timesCode:Private Sub Form_Load()
SendKeys "%{F}"
SendKeys "{DOWN}"
End Sub
It's a cheap solution however.
any other way rather than using sendkeys function.
coz sometimes sendkeys not works.