Export (0) Print
Expand All

ToolBar.Band Property

Gets or sets a value that indicates where the toolbar should be located in the ToolBarTray. This is a dependency property.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public int Band { get; set; }
/** @property */
public int get_Band ()

/** @property */
public void set_Band (int value)

public function get Band () : int

public function set Band (value : int)

<object Band="int" .../>

Property Value

The band of the ToolBarTray in which the toolbar is positioned. The default is 0.

Identifier field

BandProperty

Metadata properties set to true

None

The position of the ToolBar in a ToolBarTray depends on the values of the ToolBarTray.Orientation, Band, and BandIndex properties. When Orientation is set to Horizontal, a band represents a row in the ToolBarTray. When Orientation is Vertical, a band represents a column of the ToolBarTray. The following table describes the relationship between Orientation, Band, and BandIndex.

Orientation

Band

BandIndex

Horizontal

Indicates the row in which the ToolBar is positioned. Toolbars that have Band set to smaller a value are above those with a larger value.

Indicates the position of the ToolBar on the Band. Toolbars that have BandIndex set to smaller a value are to the left of those with a larger value.

Vertical

Indicates the column in which the ToolBar is positioned. Toolbars that have Band set to smaller a value are to the left of those with a larger value.

Indicates the position of the ToolBar on the Band. Toolbars that have BandIndex set to smaller a value are above those with a larger value.

The following example shows how use this property to place ToolBar controls inside a ToolBarTray.

<ToolBarTray Background="White">
            <ToolBar Band="1" BandIndex="1">
                <Button><Image Source="toolbargraphics\cut.bmp" /></Button>
                <Button><Image Source="toolbargraphics\copy.bmp" /></Button>
                <Button><Image Source="toolbargraphics\paste.bmp" /></Button>
           </ToolBar>
           <ToolBar Band="2" BandIndex="1">
                <Button><Image Source="toolbargraphics\undo.bmp" /></Button>
                <Button><Image Source="toolbargraphics\redo.bmp" /></Button>
           </ToolBar>
           <ToolBar Band="2" BandIndex="2">
                <Button><Image Source="toolbargraphics\paint.bmp" /></Button>
                <Button><Image Source="toolbargraphics\spell.bmp" /></Button>
                <Separator/>
                <Button><Image Source="toolbargraphics\save.bmp" /></Button>
                <Button><Image Source="toolbargraphics\open.bmp" /></Button>
           </ToolBar>
        </ToolBarTray>

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft