PDA

Click to See Complete Forum and Search --> : Add items to menustrip


venerable bede
Mar 15th, 2006, 06:55 AM
version 2.0
VS 2005

I know this is going to sound silly but how the hell do I add a new item to a menustrip in code if it is called mainmenu1 with a single menu item called menuitem1 ?

Highly Embaressed here :blush:

jmcilhinney
Mar 15th, 2006, 07:09 PM
One of the good things about the .NET Framework is that it's built in a very consistent way. If an object has child objects it will always have a property that is a collection that contains those child objects. This means that if you know how to do something for one type of object then you basically know howe to perform the analogous operation for a similar object. In the case of a ToolStripMenuItem object this collection property is DropDownItems.