Border.Background プロパティ

定義

Border の境界の間の領域を塗りつぶす Brush を取得または設定します。Gets or sets the Brush that fills the area between the bounds of a 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

プロパティ値

Brush

背景を描画する BrushThe Brush that draws the background. このプロパティに既定値はありません。This property has no default value.

次の例では、Extensible Application Markup Language (XAML)Extensible Application Markup Language (XAML) とコードを使用して、Background プロパティの値を設定する方法を示します。The following example shows how to set the value of the Background property by using Extensible Application Markup Language (XAML)Extensible Application Markup Language (XAML) and code.

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">

注釈

依存プロパティ情報Dependency Property Information

識別子フィールドIdentifier field BackgroundProperty
メタデータプロパティが true に設定されるMetadata properties set to true AffectsRender, SubPropertiesDoNotAffectRenderAffectsRender, SubPropertiesDoNotAffectRender

適用対象