Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • Leaders
Posted

do you want the text of the menuitem?

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...

Me.Menu.MenuItems(0).Text = "new text"

Posted

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.

  • Leaders
Posted

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.?

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"

Posted
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
  • 1 year later...
Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...