Border.BorderBrush 屬性

定義

取得或設定套用至Border邊緣區域的Brush

public:
 property Brush ^ BorderBrush { Brush ^ get(); void set(Brush ^ value); };
Brush BorderBrush();

void BorderBrush(Brush value);
public Brush BorderBrush { get; set; }
var brush = border.borderBrush;
border.borderBrush = brush;
Public Property BorderBrush As Brush
<Border BorderBrush="{StaticResource resourceName}"/>
- or -
<Border BorderBrush="colorString"/>
- or -
<Border>
  <Border.BorderBrush>singleBrush</Border.BorderBrush>
</Border>

屬性值

填滿框線的筆刷。 預設值為 null, (null 筆刷) 評估為 透明 以進行轉譯。

範例

此範例示範如何使用內嵌定義的屬性值 「Blue」,將 BorderBrush 值設定為純色。 XAML 剖析器會使用此 「Blue」 值來參考具名色彩 Colors.Blue,並建立提供運行時間值的 SolidColorBrush 實例。

<Border BorderThickness="5" BorderBrush="Blue" >
    <StackPanel Grid.Column="0" Grid.Row="0">
        <TextBlock Text="One"/>
        <TextBlock Text="Two"/>
        <TextBlock Text="Three"/>
    </StackPanel>
</Border>

備註

BorderThickness值必須大於 0,才能看到 BorderBrush 值生效。

適用於

另請參閱