Bagikan melalui


Border.Background Properti

Definisi

Mendapatkan atau mengatur Brush yang mengisi area di antara batas-batas Border.

public:
 property System::Windows::Media::Brush ^ Background { System::Windows::Media::Brush ^ get(); void set(System::Windows::Media::Brush ^ value); };
public System.Windows.Media.Brush Background { get; set; }
member this.Background : System.Windows.Media.Brush with get, set
Public Property Background As Brush

Nilai Properti

Yang Brush menggambar latar belakang. Properti ini tidak memiliki nilai default.

Contoh

Contoh berikut menunjukkan cara mengatur nilai Background properti dengan menggunakan Extensible Application Markup Language (XAML) dan kode.

myBorder1 = new Border();
myBorder1.BorderBrush = Brushes.SlateBlue;
myBorder1.BorderThickness = new Thickness(5, 10, 15, 20);
myBorder1.Background = Brushes.AliceBlue;
myBorder1.Padding = new Thickness(5);
myBorder1.CornerRadius = new CornerRadius(15);
Dim myBorder1 As New Border()
myBorder1.BorderBrush = Brushes.SlateBlue
myBorder1.BorderThickness = New Thickness(5, 10, 15, 20)
myBorder1.Background = Brushes.AliceBlue
myBorder1.Padding = New Thickness(5)
myBorder1.CornerRadius = New CornerRadius(15)
<Border BorderBrush="SlateBlue" BorderThickness="5,10,15,20" Background="AliceBlue" Padding="5" CornerRadius="15">

Keterangan

Informasi Properti Dependensi

Bidang pengidentifikasi BackgroundProperty
Properti metadata diatur ke true AffectsRender, SubPropertiesDoNotAffectRender

Berlaku untuk