Control.SkinID Control.SkinID Control.SkinID Control.SkinID Property


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

 virtual property System::String ^ SkinID { System::String ^ get(); void set(System::String ^ value); };
public virtual string SkinID { get; set; }
member this.SkinID : string with get, set
Public Overridable Property SkinID As String


要套用至控制項之面板的名稱。The name of the skin to apply to the control. 預設為 EmptyThe default is Empty.


已套用樣式表。The style sheet has already been applied.

-或--or- Page_PreInit 事件已發生。The Page_PreInit event has already occurred.

-或--or- 控制項已加入至 Controls 集合。The control was already added to the Controls collection.


面板控制項可以使用包含在一或多個面板檔案中的佈景主題的目錄。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 settings 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 themes. 如果已定義識別碼的外觀Image控制項,則該面板只適用於Image控制項SkinID屬性設定為該識別碼。If a skin with an ID is defined for an Image control, then that skin applies only to Image controls whose SkinID property is set to that ID.

如果佈景主題目錄中的面板檔案未包含具有指定的外觀SkinID屬性,ArgumentException在執行階段擲回例外狀況。If the skin files in a theme directory do not contain a skin with the specified SkinID property, an ArgumentException exception is thrown at run time.