JayWhite Posted May 27, 2003 Posted May 27, 2003 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 Quote
*Gurus* divil Posted May 27, 2003 *Gurus* Posted May 27, 2003 Why do you need it? Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Leaders dynamic_sysop Posted May 27, 2003 Leaders Posted May 27, 2003 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" Quote
JayWhite Posted May 27, 2003 Author Posted May 27, 2003 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. Quote
Leaders dynamic_sysop Posted May 27, 2003 Leaders Posted May 27, 2003 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" Quote
JayWhite Posted May 27, 2003 Author Posted May 27, 2003 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 Quote
smit Posted November 5, 2004 Posted November 5, 2004 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.