Bagikan melalui


Control.BorderBrush Properti

Definisi

Mendapatkan atau mengatur kuas yang menjelaskan latar belakang batas kontrol.

public:
 property System::Windows::Media::Brush ^ BorderBrush { System::Windows::Media::Brush ^ get(); void set(System::Windows::Media::Brush ^ value); };
[System.ComponentModel.Bindable(true)]
public System.Windows.Media.Brush BorderBrush { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.BorderBrush : System.Windows.Media.Brush with get, set
Public Property BorderBrush As Brush

Nilai Properti

Kuas yang digunakan untuk mengisi batas kontrol; defaultnya adalah Transparent.

Atribut

Contoh

Contoh berikut menunjukkan cara mengatur properti kuas batas kontrol.

<Button Name="btn6" BorderBrush="Red" 
        Click="ChangeBorderBrush">
  BorderBrush
</Button>
void ChangeBorderBrush(object sender, RoutedEventArgs e)
{
    if (btn6.BorderBrush == Brushes.Red)
    {
        btn6.BorderBrush = Brushes.Black;
        btn6.Content = "Control border brush changes from red to black.";
    }
    else
    {
        btn6.BorderBrush = Brushes.Red;
        btn6.Content = "BorderBrush";
        }
}
Private Sub ChangeBorderBrush(ByVal Sender As Object, ByVal e As RoutedEventArgs)

    If (Equals(btn6.BorderBrush, Brushes.Red)) Then

        btn6.BorderBrush = Brushes.Black
        btn6.Content = "Control border brush changes from red to black."

    Else

        btn6.BorderBrush = Brushes.Red
        btn6.Content = "BorderBrush"
    End If
End Sub

Keterangan

Properti ini hanya memengaruhi kontrol yang templatnya menggunakan BorderBrush properti sebagai parameter. Pada kontrol lain, properti ini tidak berdampak.

Informasi Properti Dependensi

Item Nilai
Bidang pengidentifikasi BorderBrushProperty
Properti metadata diatur ke true AffectsRender, SubPropertiesDoNotAffectRender

Berlaku untuk