[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.
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.
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.
:thumb:
Re: [2005] Adding Menu Items to a Menu Control at Run Time
If your problem has been solved then please mark the thread resolved.