|
-
Jun 3rd, 2007, 11:54 AM
#1
Thread Starter
Hyperactive Member
[2005] [RESOLVED] Adding Menu Items to a Menu Control at Run Time
I keep finding help for pre .NET 2005 menu questions so I need a straight answer:
What's the code for adding a new menu item during runtime to a menu control created at design time? I also need an event handler as well.
Thanks.
Last edited by neef; Jun 3rd, 2007 at 01:39 PM.
-
Jun 3rd, 2007, 01:09 PM
#2
Hyperactive Member
Re: [2005] Adding Menu Items to a Menu Control at Run Time
Well your topic specified 2005 so I will use that.
Create a new ToolStripMenuItem like so:
Code:
Dim myNewToolStripMenuItem as New ToolStripMenuItem
Now you can add it to the existing menu like so:
Code:
myExistingMenu.Items.Add(myNewToolStripMenuItem)
By the way, those examples were found by viewing the designer.vb file in my project.
Prefix has no suffix, but suffix has a prefix.
-
Jun 3rd, 2007, 01:28 PM
#3
Thread Starter
Hyperactive Member
Re: [2005] Adding Menu Items to a Menu Control at Run Time
Thank you.
It hit me after I posted that I could check my designer and whatever code I needed would be there.
-
Jun 3rd, 2007, 01:31 PM
#4
Hyperactive Member
Re: [2005] Adding Menu Items to a Menu Control at Run Time
If your problem has been solved then please mark the thread resolved.
Prefix has no suffix, but suffix has a prefix.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|