How to drop down menu at run time?

  • Thread starter Thread starter Arjun Zacharia
  • Start date Start date
A

Arjun Zacharia

hi,
im building a voice enabled application using VC#,in which
we try to control the menu using Voice commands.. for
example if thereb are menus like .. " file " " edit" ..etc
then when i say file.. i want the file menu to drop down..
how do i do that?
plz reply soon
thank you
arjun
 
Use SendKeys.Send to hit the accelerators for the menu items:

To define the accelerators use & in the Text of the menu item.

&File
-> &Open

Then open the menu by sending the keystroke to the window:
SendKeys.Send("%F"); // opens the menu -- Alt + F
//SendKeys.Send("%O"); // clicks the open item -- Alt + O

Or could manually call the click handler that's registered to listen to that
event. If the handler is defined as...
private void menuItem2_Click(object sender, System.EventArgs e)
{
// "&Open" menu click handler
}

just call:
menuItem2_Click(this, null);


HTH;
Eric Cadwell
http://www.origincontrols.com
 
Back
Top