MobileControl.ForeColor 属性


获取或设置样式的指定前景色。Gets or sets the specified foreground color for the style. 此属性通常用于设置文本颜色。Typically, this property sets the color for the text. 默认值为 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.

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


样式的指定前景色。The specified foreground color for the style.



您可以使用 ForeColor 属性,以不同的颜色显示后面的 "继承" 部分中列出的所有控件和类的文本。You can use the ForeColor property to display text in different colors for all the controls and classes listed in the Inheritance section that follows. 例如,在 AdRotator中,设置 ForeColor 属性将更改控件中的文本的颜色;在 Calendar中,它更改日历中文本的颜色;在 ValidationSummary中,它更改错误消息的文本颜色。For example, in the AdRotator, setting the ForeColor property changes the color of the text in the control; in the Calendar, it changes the color of the text in the calendar; and in the ValidationSummary, it changes the color of the text of the error messages.

可用于颜色的字符串是一组固定的颜色和十六进制的 RGB 值。The strings that can be used for colors are a set of fixed colors and hexadecimal RGB values. 还可以通过 "#RRGGBB" 格式指定这些值。These values can also be specified in the form "#RRGGBB." 例如,"#bb7023"。For example, "#bb7023".

你还可以使用 Microsoft Windows 颜色常数。You can also use the Microsoft Windows color constants. 有关具体的详细信息,请参阅 SystemColorsFor specific details, see SystemColors.