語言

Border.BorderBrush 屬性

定義

取得或設定套用到邊框邊緣區域的畫筆。

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(空筆刷),渲染時會被評估為 透明 。

範例

這個範例展示了如何使用內嵌定義的屬性值「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 值才會生效。

適用於

另請參閱