R
Robin Tucker
Hi there,
I need to add a click handler to a derived menu item class. I am using the
same handler to handle all of the items in the given menu, but need to
derive a new menu item class in order to store a little extra information
for each item.
Previously, I was writing:
MyMenu.MenuItems.Add ( "the text label", New EventHandler(AddressOf
MyMenuItem_Clicked)
where MyMenu_Clicked is the handler to use. Now I want to write:
Dim theItem as new MyMenuItemClass("the text label")
MyMenu.MenuItems.Add ( theItem )
...... --> somehow add the event handler MyMenuItem_Clicked to be the same
for each item in MyMenu.
This is a dynamic menu, so I can't hard-code each one. I notice there isn't
a MenuItems.Add method for MenuItem, EventHandler, although there is one for
String, EventHandler.
Thanks for any help you can give.
I need to add a click handler to a derived menu item class. I am using the
same handler to handle all of the items in the given menu, but need to
derive a new menu item class in order to store a little extra information
for each item.
Previously, I was writing:
MyMenu.MenuItems.Add ( "the text label", New EventHandler(AddressOf
MyMenuItem_Clicked)
where MyMenu_Clicked is the handler to use. Now I want to write:
Dim theItem as new MyMenuItemClass("the text label")
MyMenu.MenuItems.Add ( theItem )
...... --> somehow add the event handler MyMenuItem_Clicked to be the same
for each item in MyMenu.
This is a dynamic menu, so I can't hard-code each one. I notice there isn't
a MenuItems.Add method for MenuItem, EventHandler, although there is one for
String, EventHandler.
Thanks for any help you can give.