Hide MenuItem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have the name of a MenuItem in a string variable

strNombreMenuItem = "MenuItem1"

I know this MenuItem1 was declared an instaciated in the form as a part of a
Mainmenu.

Now, I need to disable this object (MenuItem1) but I only have it's name.
How a get a reference to this object? I neede the reference buecause I need
to disable it.

Thanks in advance....
 
Chevy said:
I have the name of a MenuItem in a string variable

strNombreMenuItem = "MenuItem1"

I know this MenuItem1 was declared an instaciated in the form as a part of
a
Mainmenu.

Now, I need to disable this object (MenuItem1) but I only have it's name.
How a get a reference to this object? I neede the reference buecause I
need
to disable it.

Add all menu items to a 'Hashtable' and use the name as key and the
reference to the menu item as value. Then you can easily get a reference to
a certain menu item by its name.
 
Back
Top