WebControl.SkinID 屬性


取得或設定要套用至控制項的面板。Gets or sets the skin to apply to the control.

 virtual property System::String ^ SkinID { System::String ^ get(); void set(System::String ^ value); };
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 ,則該面板會套用至所有 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 ,則該面板只會套用至 ImageSkinID 設定為該識別碼的控制項。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.