Border.BorderBrush 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
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 值才會生效。