TextBoxBase.BackColor TextBoxBase.BackColor TextBoxBase.BackColor TextBoxBase.BackColor Property

定義

取得或設定控制項的背景色彩。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,表示控制項的背景。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. 例如,如果BackColorForeColor屬性都設定為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的屬性TextBoxBase設定為true,則這個屬性可能會高於 ridden。This property might be over ridden if the ReadOnly property of the TextBoxBase is set to true.

適用於

另請參閱