TextBoxBase.BackColor 屬性

定義

取得或設定控制項的背景色彩。Gets or sets the background color of the control.

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

屬性值

Color

Color,表示控制項的背景。A Color that represents the background of the control.

備註

您可以使用 BackColor 屬性,將文字控制項的背景色彩變更為 blend 至表單的色彩配置。You can use the BackColor property to change the background color of the text control to blend into the color scheme of your forms.

若要變更控制項中文字的色彩,請使用 ForeColor 屬性。To change the color of the text within the control, use the ForeColor property. 設定 BackColor 文字控制項的屬性時,請確定您選擇的色彩不會讓控制項的文字消失。When setting the BackColor property of your text control, ensure that the color you choose does not cause the text of the control to disappear. 例如,如果 BackColor 和屬性都 ForeColor 設為 Color.Black ,則 textbox 控制項內的文字將不會顯示。For example, if the BackColor and ForeColor properties are both set to Color.Black, the text within your textbox control will not be visible.

如果的 ReadOnly 屬性設定為,則這個屬性可能會超過 ridden TextBoxBase trueThis property might be over ridden if the ReadOnly property of the TextBoxBase is set to true.

適用於

另請參閱