ToolStripContainer


The ToolStripContainer control contains a ToolStripPanel along each of its edges where a ToolStrip control can dock. The control’s center is filled with another ToolStripPanel that can contain other controls that are not part of the menus.

The user can drag the ToolStrips around and position them inside of any of the ToolStripPanel controls much as you can move the menus in the Visual Basic development envirtonment. The user can drag the ToolStrips into multiple rows or columns within the panels.

Figure G-29 shows a form containing a ToolStripContainer with its Dock property set to Fill, so it fills the form. The lighter area in the middle is a PictureBox sitting inside the middle ToolStripPanel, also with its Dock property set to Fill.

image from book
Figure G-29: The ToolStripContainer control lets the user rearrange ToolStrip controls at runtime.

The ToolStripContainer holds five ToolStrip controls positioned in the container’s various edge panels. The ToolStrip3 control’s TextDirection property is set to Vertical90, so it sits along the right edge of the form. The ToolStrip1 and ToolStrip2 controls have been dragged into two rows at the top of the form. The ToolStrip1 and ToolStrip2 controls share a row at the bottom.

The control’s LeftToolStripPanel, RightToolStripPanel, TopToolStripPanel, BottomToolStrip?Panel, and ContentPanel properties contain references to the ToolStripPanel controls that this control contains. Its LeftToolStripPanelVisible, RightToolStripPanelVisible, TopToolStripPanel?Visible, and BottomToolStripPanelVisible properties let you show or hide specific panels. For example, you can hide the bottom or side panels if you don’t want the user to drag ToolStrips there.

The ToolStripContainer control’s other properties are relatively straightforward. See the online help (msdn2.microsoft.com/library/system.windows.forms.toolstripcontainer.aspx) for more information.




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

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