ValidationSummary.ForeColor 属性

定义

获取或设置控件的前景色。

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

属性值

Color

表示控件前景色的 Color。 默认值为 Red

示例

下面的代码示例演示如何使用 ForeColor 属性指定使用蓝色文本显示验证摘要。


<asp:ValidationSummary 
     id="valSum" 
     DisplayMode="BulletList"
     ForeColor="Blue" 
     HeaderText="You must enter a value in the following fields:"
     Font-Names="verdana" 
     Font-Size="12"
     runat="server"/>

<asp:ValidationSummary 
     id="valSum" 
     DisplayMode="BulletList"
     ForeColor="Blue" 
     HeaderText="You must enter a value in the following fields:"
     Font-Names="verdana" 
     Font-Size="12"
     runat="server"/>

注解

使用此属性可指定显示来自验证控件的错误消息的颜色。

适用于

另请参阅