M
Martin
I have a menu, a rather big one. It contains about 150 items. Normally this
would mean that I'd have about 150 event handlers:
Private Sub Menu1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Menu1.Click
However, I would like to get the associated form name from a different
source and then create a single event handler:
Private Sub OpenForm (ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles AllMenus.Click
In VB2005 I can assign multiple events to a single handler by specifying
them in the 'Handles' part, but for 150 items I think this is a bit much. Is
there another way to specify a handler to menu items? Like looping through
the menus and assign a specific handler?
Tia,
Martin
would mean that I'd have about 150 event handlers:
Private Sub Menu1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Menu1.Click
However, I would like to get the associated form name from a different
source and then create a single event handler:
Private Sub OpenForm (ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles AllMenus.Click
In VB2005 I can assign multiple events to a single handler by specifying
them in the 'Handles' part, but for 150 items I think this is a bit much. Is
there another way to specify a handler to menu items? Like looping through
the menus and assign a specific handler?
Tia,
Martin