SpeakComputers.com
Home
Software
Electronics
Desktop Computers
Laptops
Games
Handheld Devices
Mobile Phones
Cameras
Camcorders
Printers
Books
Software Downloads 2012 Software Mac Software Security Student Editions Windows 7 Office 2010
ASP.NET C# VB.NET C++ .NET Infragistics DevComponents

MenuStrip Control.

The Windows MenuStrip control provides an application menu system. The menustrip works with both Single document interfaces SDI and Multiple document interfaces MDI. With MDI applications the MenuStrip can be configured to merge with the main form for better navigation.

The new Menu of Visual Studio and the .net control set allows you to add image files to the menu structure. Interface developers can now take advantage of the new look and feel of the .net control.

Namespace: System.Windows.Forms
Assembly: Systems.Windows.Forms.dll

using System.Windows.Forms;
Calling: System.Windows.Forms.MenuStrip

Adding a MenuStrip to a Form.
Using VisualStudio, adding a MenuStrip and ToolStripMenuItem is quick and easy.

With a form open in design view, double click the MenuStrip item on the toolbox. This will add the MenuStrip control to the form. To add ToolStripMenuItem, simply start building your menu structure.

Creating MenuStrips and MenuItems have never been so easy. Visual Studio 2005 make programming and developing easy and fun. Simple put, Visual Studio 2005 is a more productive programming IDE tool.

To add a MenuStrip writing code.

Create the MenuStrip control and add it to the forms.
MenuStrip MainMenu = new MenuStrip();
this.Controls.Add(MainMenu); 

Add the File menu Item and add it to the MenuStrip above.
ToolStripMenuItem File = new ToolStripMenuItem("File"); MainMenu.Items.Add(File);

Create the New menu Items and add it to the FileMenu above. We are also going to create the click event for the item.
ToolStripMenuItem New = new ToolStripMenuItem("New");
New.Click += new EventHandler(New_Click);
File.DropDownItems.Add(New);

Create the Open menu Item and ad it to the FileMenu as you did above.
ToolStripMenuItem Open = new ToolStripMenuItem("Open");
Open.Click += new EventHandler(Open_Click);
File.DropDownItems.Add(Open);

Carry on in this manner to complete your menu structure. We now need to respond to the click events we created earlier.

void New_Click(object sender, EventArgs e) { MessageBox.Show(sender.ToString()); }
void Open_Click(object sender, EventArgs e) { MessageBox.Show(sender.ToString()); }

Note:

The MenuStrip, ContextMenuStrip and ToolStrip items can use the same events.
Computer Security
AntiVirus Software
Internet Security
Parental Controls
Backup & Recovery
Computer Protection
Anti Malware
Photo & Video
Photo & Video Editing
Video Music
Desktop Publishing
Professional Design
Home Publishing
Clipart
Business & Accounting
Accounting
Payroll
Check Printing
TAX
H&R Block
Microsoft Office
Design
Graphic Design
Home Design
Garden Design
Interior Design
Computer Aided Design
3D Design
Students & Teacher
Adobe
Microsoft Office
Dragon Naturally Speaking
Corel Draw
Serif
Student/Teacher Software
Copy Right 2006 SpeakComputers.com - All Rights Reserved.
Home About Privacy Policy Resouces