Export (0) Print
Expand All

ToolBar.Band Property

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

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

member Band : int with get, set
<object Band="int" .../>

Property Value

Type: System.Int32
The band of the ToolBarTray in which the toolbar is positioned. The default is 0.

Identifier field

BandProperty

Metadata properties set to true

AffectsParentMeasure

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 a smaller value are above those with a larger value.

Indicates the position of the ToolBar on the Band. Toolbars that have BandIndex set to a smaller 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 a smaller 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 a smaller 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>

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft