WindowsFormsHost.Background 屬性

定義

取得或設定裝載控制項的背景以作為環境屬性。Gets or sets the hosted control's background as an ambient property.

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

屬性值

設定為背景色彩的 BrushA Brush set to the background color.

備註

這個相依性屬性是由BackgroundProperty欄位所識別。This dependency property is identified by the BackgroundProperty field. 根據預設,這個屬性會對應以更新Control.BackColor裝載控制項的和Control.BackgroundImage屬性。By default, this property is mapped to update the Control.BackColor and Control.BackgroundImage properties of the hosted control.

如需對應Background屬性的詳細資訊,請參閱Windows Forms 和 WPF 屬性對應For more information on mapping the Background property, see Windows Forms and WPF Property Mapping.

XAML Attribute UsageXAML Attribute Usage

<object Background="Brush"/>  

XAML 值XAML Values

筆刷Brush
Brush參閱 for XAML 屬性語法。See Brush for XAML Attribute syntax.

相依性屬性資訊Dependency Property Information

識別碼欄位Identifier field BackgroundProperty
中繼資料屬性設定為trueMetadata properties set to true AffectsRenderSubPropertiesDoNotAffectRenderAffectsRender, SubPropertiesDoNotAffectRender

適用於

另請參閱