ToolStrip.BackColor ToolStrip.BackColor ToolStrip.BackColor ToolStrip.BackColor Property

定义

获取或设置 ToolStrip 的背景色。Gets or sets the background color for the ToolStrip.

public:
 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

属性值

一个 Color,表示 ToolStrip 的背景色。A Color that represents the background color of the ToolStrip. 默认为 DefaultBackColor 属性的值。The default is the value of the DefaultBackColor property.

注解

BackColor属性不支持透明的颜色,除非SupportsTransparentBackColor的值System.Windows.Forms.ControlStyles设置为trueThe BackColor property does not support transparent colors unless the SupportsTransparentBackColor value of System.Windows.Forms.ControlStyles is set to true.

BackColor属性是一个环境属性。The BackColor property is an ambient property. 环境属性是控件属性,如果未设置,检索从父控件。An ambient property is a control property that, if not set, is retrieved from the parent control. 例如,Button具有相同BackColor作为其父Form默认情况下。For example, a Button will have the same BackColor as its parent Form by default. 有关环境属性的详细信息,请参阅AmbientProperties类或Control类概述。For more information about ambient properties, see the AmbientProperties class or the Control class overview.

继承者说明

重写时BackColor属性在派生类中,使用基类的BackColor属性扩展的基实现。When overriding the BackColor property in a derived class, use the base class's BackColor property to extend the base implementation. 否则,必须提供所有的实现。Otherwise, you must provide all the implementation. 不需要重写二者getset访问器BackColor属性; 您可以根据需要覆盖只有一个。You are not required to override both the get and set accessors of the BackColor property; you can override only one if needed.

适用于