Name of a MenuItem

JayWhite

Newcomer
Joined
May 23, 2003
Messages
3
I need to get the name of a MenuItem, i get the object (the MenuItem) with the index of it in the menucollection. Like This
frmMain.mnuMain.MenuItems(index)

Does anybody can help me ? to find this name ?


P.S. Why do Microsoft Removes the .name property of menu ?

Jay
 
do you want the text of the menuitem?
Visual Basic:
Me.Text = Me.Menu.MenuItems(0).Text
'// in that case i had 1 menuitem , with an index of 0
and then i changed the caption of the menuitem...
Visual Basic:
Me.Menu.MenuItems(0).Text = "new text"
 
I need it to write it in a table in my database for a later use, it's really essential.

What i call the name is really the name of the MenuItem, like mnuFile or something like that.
 
how and when do you want to save the menu name? on click or on a button / on unload ?
have you tried making a string array and then naming the items in that.?
Visual Basic:
Dim strString() as String
'//look at your menuitem in the properties toolbox to get the 
'//name / index in design time ( eg: MenuItem1 , named "test" )
strString(index) = "MenuItem1"
 
On load of a form, but could also be at load of the application, the menu already exists and the name are already there, so i can't name the menuitems from a string array. I just need to be able to get the name of a particular MenuItem and thereafter i'll be ok to code the rest. I'm trying with System.Reflection right now .... not really successful
 
hi Jay,
I'm facing the same problem with menus. They r Predefined and i want to retrive rights from table and enable / disable them but where is the name property???
if u got any soln. do let me know. I'll be grateful.
thanks smita
 
Back
Top