Menus and Toolbars


The "Menus and Toolbars" category in the Toolbox contains controls that are responsible for providing pop-up contextual menus, main form-wide menus, strips that contain buttons and other interactive content, and the status bar strip. This section provides you with an overview of the controls in this category.

The ContextMenuStrip Control

The ContextMenuStrip control is a menu strip that appears when the user right-clicks on a control to bring up a list of options that relate to the context at hand. For example, when a user right-clicks the name of a contact in a contact list, a context menu could appear providing options relating specifically to that contact. Figure 35.5 shows a ContextMenuStrip in action. As you can see from this figure, the menus in Windows Forms 2.0 are all upgraded from previous versions, and adding iconic treatment to the menus is now only a few clicks away.

Figure 35.5. The ContextMenuStrip control.


The MenuStrip Control

The MenuStrip control is very much like the ContextMenuStrip. Menus created using this control are used to provide a menu that is typically docked on the top of a form.

The StatusStrip Control

The StatusStrip control allows you to display a wide variety of content that is docked to the bottom of a form. This area is usually used to display status messages to keep the user informed about tasks that may be going on in the background or the task most recently performed. You can also use this area to display the current time, currently logged-in user, status icons, and more.

The ToolStrip Control

The ToolStrip is a strip that contains interactive content such as buttons, dividers, text, icons, and so on. These ToolStrips function exactly the same way the toolbars in Microsoft Office function. In fact, the look and feel is almost the same as that of Microsoft Office. The ToolStrip provides more enhanced functionality and a much more professional look than the toolbar controls provided in previous versions of Windows Forms.

The ToolStripContainer Control

The ToolStripContainer provides a way of storing ToolStrips such that they can be moved around and dragged along the top, left, right, and bottom of the container. You can dynamically add and remove ToolStrips from a container at runtime, giving you a lot of the functionality that required significant development time in the past at your fingertips for free. Again, the ToolStripContainer can add a lot of power to an application and a lot of functionality that resembles Microsoft Office.



Microsoft Visual C# 2005 Unleashed
Microsoft Visual C# 2005 Unleashed
ISBN: 0672327767
EAN: 2147483647
Year: 2004
Pages: 298

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net