Shortcut keys for dynamically created MenuItems...

  • Thread starter Thread starter Glenn Carr
  • Start date Start date
G

Glenn Carr

I'm attempting to add Shortcut keys for dynamically created MenuItems,
and they simply aren't firing when the shortcut key is pressed. Here
is a snippet of the code...

....
MenuItem = new MenuItem( ... );
mi.ShowShortcut = true;
mi.Shortcut = action.Shortcut;
mi.Click += new EventHandler( action.Invoke );
miMainAction.MenuItems.Add( insertPosition++, mi );
....


Is there something I need to do to hook up these shortcut keys since I
am adding them on the fly?
 
Never mind.... I am an idiot.

Since the menu item isn't created until the parent menu item's popup
event, it stands to reason that the non-existent menuitem's event
wouldn't fire.
 
Back
Top