語言

ToolBar.Band 屬性

定義

取得或設定一個值,指示工具列應該在 ToolBarTray.

public:
 property int Band { int get(); void set(int value); };
public int Band { get; set; }
member this.Band : int with get, set
Public Property Band As Integer

屬性值

工具列所在的帶 ToolBarTray 狀區域。 預設值是 0。

範例

以下範例說明如何利用此特性在 ToolBarToolBarTray。

<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>

備註

在 a 中的位置ToolBar取決於 、 ToolBarTray、 及ToolBarTray.Orientation性質的值Band。BandIndex 當 Orientation 設為 Horizontal時,帶狀代表 中的一列 ToolBarTray。 當 Orientation 是 Vertical時,一條帶代表 的 ToolBarTray一欄。 下表描述了 、 Orientation、 與 Band之間的關係BandIndex。

導覽 樂團 樂團索引
水平 表示 該 ToolBar 的位置。 設定 Band 為較小值的工具列高於設定為較大值的工具列。 表示 在 ToolBarBand上的位置。 設定 BandIndex 為較小值的工具列會位於較大值的工具列左側。
垂直 表示 所在 ToolBar 的欄位。 設定 Band 為較小值的工具列會位於較大值的工具列左側。 表示 在 ToolBarBand上的位置。 設定 BandIndex 為較小值的工具列高於設定為較大值的工具列。

相依財產資訊

Item 價值觀
識別碼欄位 BandProperty
元資料屬性設為 true AffectsParentMeasure

適用於

另請參閱