V
Vince
I'm creating a dynamic menu. I've extended the menuitem
class to have a "form name" property. This property is
the name of the form that I will open when the menuitem
is selected.
Here's my code to open up the form:
Dim menuItem As MyMenuItem.MyMenuItem = DirectCast
(sender, MyMenuItem.MyMenuItem)
Dim myFormName As String = menuItem.itemName
Dim frm As Form = Activator.CreateInstance
(Type.GetType(myFormName))
frm.Show()
The only problem I have with this is that it's creating
multiple forms if I choose the menuitem multiple times.
If the form is already loaded, I want to bring that form
into focus, not open a totally new form.
Any ideas how to do this? (this is not a MDI forms)
class to have a "form name" property. This property is
the name of the form that I will open when the menuitem
is selected.
Here's my code to open up the form:
Dim menuItem As MyMenuItem.MyMenuItem = DirectCast
(sender, MyMenuItem.MyMenuItem)
Dim myFormName As String = menuItem.itemName
Dim frm As Form = Activator.CreateInstance
(Type.GetType(myFormName))
frm.Show()
The only problem I have with this is that it's creating
multiple forms if I choose the menuitem multiple times.
If the form is already loaded, I want to bring that form
into focus, not open a totally new form.
Any ideas how to do this? (this is not a MDI forms)