WebControl.SkinID WebControl.SkinID WebControl.SkinID WebControl.SkinID Property

定义

获取或设置要应用于控件的外观。Gets or sets the skin to apply to the control.

public:
 virtual property System::String ^ SkinID { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Browsable(true)]
public override string SkinID { get; set; }
member this.SkinID : string with get, set
Public Overrides Property SkinID As String

属性值

要应用于控件外观的名称。The name of the skin to apply to the control. 默认值为 EmptyThe default is Empty.

异常

主题中不存在 SkinID 属性中指定的外观。The skin specified in the SkinID property does not exist in the theme.

注解

控件的可用外观包含在主题目录中的一个或多个外观文件中。Skins available to a control are contained in one or more skin files in a theme directory. SkinID属性指定要应用于控件的外观。The SkinID property specifies which of these skins to apply to the control. 外观特定于特定控件;不能在不同类型的控件之间共享外观设置。A skin is specific to a particular control; you cannot share skin setting between controls of different types.

如果未设置SkinID属性,控件将使用默认外观(如果已定义)。If you do not set the SkinID property, a control uses the default skin if one is defined. 例如,如果为Image控件定义了没有 ID 的外观,则该外观适用于未按 ID 显式引用外观且未设置为禁用主题的所有Image控件。For example, if a skin without an ID is defined for an Image control, then that skin applies to all Image controls that do not explicitly reference a skin by ID and that are not set to disable theming. 如果为Image控件定义了具有 ID 的外观,则该外观仅Image适用于其SkinID设置为该 id 的控件。If a skin with an ID is defined for an Image control, then that skin applies to only Image controls whose SkinID is set to that ID.

如果主题目录中的外观文件不包含具有指定SkinID的外观ArgumentException ,则在运行时将引发异常。If the skin files in a theme directory do not contain a skin with the specified SkinID, an ArgumentException exception is thrown at runtime.

适用于

另请参阅