Style.BackColor 属性


获取或设置样式的指定背景色。Gets or sets the specified background color for the style. 默认值为 EmptyThe default value is Empty. 此 API 已废弃不用。This API is obsolete. 若要了解如何开发 ASP.NET 移动应用,请参阅 Mobile Apps & Sites with ASP.NET (ASP.NET 移动应用和网站)。For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

 property System::Drawing::Color BackColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };
public System.Drawing.Color BackColor { get; set; }
member this.BackColor : System.Drawing.Color with get, set
Public Property BackColor As Color


样式的指定背景色。The specified background color for the style.



与其他属性不同,BackColor 属性不从其父级继承。Unlike the other properties, the BackColor property is not inherited from its parent. 例如,如果在父控件上将 "BackColor" 属性设置为 "青色",则子控件不会继承蓝绿色的背景色;必须将子控件的 BackColor 属性显式设置为青色,或者必须设置父控件的 BackColor 属性,并将样式表应用于子控件。For example, if you set the BackColor property to cyan on a parent control, a child control will not inherit a background color of cyan; you must explicitly set the child control's BackColor property to cyan, or you must set the BackColor property of the parent control and apply the style sheet to the child control. 这与级联样式表的行为一致。This is consistent with the behavior of cascading style sheets.