menuitem name

  • Thread starter Thread starter Edwin Bach
  • Start date Start date
E

Edwin Bach

how can you get the name of a menuitem programatically and return is as a
string, for example if
Friend WithEvents mnuExit As System.Windows.Forms.MenuItem

is defined how can you go get the mnuExit

TIA

Ed
 
Edwin Bach said:
how can you get the name of a menuitem programatically and return is
as a string, for example if
Friend WithEvents mnuExit As System.Windows.Forms.MenuItem

is defined how can you go get the mnuExit

Why do you need it? I ask because variables names are out of interest at run
time. You can identify the menu item by the reference. Or, you can add menu
items to a Hashtable and use an expressive name as the key.
 
using a database to drive authorizations for users. want to use the name of
the menu item to look up then enable/disable or visible/not visible
 
* "Edwin Bach said:
using a database to drive authorizations for users. want to use the name of
the menu item to look up then enable/disable or visible/not visible

As Armin mentioned, you can do this by storing (name, reference) pairs
in a 'Hashtable'.
 
Back
Top