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>

備註

中 的位置 ToolBar 取決於 、 BandBandIndex 屬性的值 ToolBarTray.OrientationToolBarTray 當 設定為 HorizontalOrientation ,帶代表 中的資料 ToolBarTray 列。 當 為 VerticalOrientation ,帶表示 的資料 ToolBarTray 行。 下表描述 、 BandBandIndex 之間的 Orientation 關聯性。

方向 樂隊 BandIndex
水平 指出 所在的資料列 ToolBar 。 已 Band 設定為較小值的工具列高於具有較大值的工具列。 表示 上 Band 的位置 ToolBar 。 已 BandIndex 設定為較小值的工具列會位於具有較大值的工具列左邊。
Vertical 指出 所在的資料行 ToolBar 。 已 Band 設定為較小值的工具列會位於具有較大值的工具列左邊。 表示 上 Band 的位置 ToolBar 。 已 BandIndex 設定為較小值的工具列高於具有較大值的工具列。

相依性屬性資訊

識別碼欄位 BandProperty
中繼資料屬性設定為 true AffectsParentMeasure

適用於

另請參閱