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.

備註

除非的值System.Windows.Forms.ControlStyles設為BackColortrue否則屬性不支援透明色彩。 SupportsTransparentBackColorThe 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相同的父系FormFor 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. 您不需要覆寫get BackColor屬性的和set存取子,只有在需要時,才能覆寫其中一個。You are not required to override both the get and set accessors of the BackColor property; you can override only one if needed.

適用於