共用方式為


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"/>

備註

使用此屬性可指定顯示來自驗證控制項之錯誤訊息的色彩。

適用於

另請參閱