CreateUserWizard.ValidatorTextStyle 属性

定义

获取对 Style 对象的引用,该对象允许您设置验证错误消息的外观。

public:
 property System::Web::UI::WebControls::Style ^ ValidatorTextStyle { System::Web::UI::WebControls::Style ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.Style ValidatorTextStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.ValidatorTextStyle : System.Web.UI.WebControls.Style
Public ReadOnly Property ValidatorTextStyle As Style

属性值

一个包含样式属性的 Style,这些样式属性用于定义控件上的验证错误消息的外观。 默认值为 NULL。

属性

注解

ValidatorTextStyle使用 属性可更改针对输入验证错误显示的消息的外观。 默认情况下, ValidatorTextStyle 设置为以红色显示以下消息:

属性 ValidatorTextStyle 是只读的;但是,您可以设置它返回的对象 Style 的属性。 您可以以声明方式以 形式 Property-Subproperty设置这些属性,其中 Subproperty 表示 Style 类 (的属性, ValidatorTextStyle-ForeColor 例如,) 。 可以采用 (格式 Property.Subproperty 以编程方式设置 属性, ValidatorTextStyle.ForeColor 例如,) 。

常见设置包括自定义背景色、文本颜色和字体属性。 属性的 ValidatorTextStyle 样式设置与控件的样式设置 CreateUserWizard 合并。 属性中 ValidatorTextStyle 应用的任何设置将替代 控件属性 CreateUserWizard 中的相应设置。

以下 CreateUserWizard 样式属性由 ValidatorTextStyle 设置替代:

但是,使用模板定义控件的外观 CreateUserWizard 时, ValidatorTextStyle 属性不起作用。

适用于

另请参阅