Control.EnableTheming Control.EnableTheming Control.EnableTheming Control.EnableTheming Property

定義

取得或設定值,指出佈景主題是否套用至此控制項。Gets or sets a value indicating whether themes apply to this control.

public:
 virtual property bool EnableTheming { bool get(); void set(bool value); };
[System.ComponentModel.Browsable(false)]
[System.Web.UI.Themeable(false)]
public virtual bool EnableTheming { get; set; }
member this.EnableTheming : bool with get, set
Public Overridable Property EnableTheming As Boolean

屬性值

true 表示使用主題,否則為 falsetrue to use themes; otherwise, false. 預設為 trueThe default is true.

例外狀況

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

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

備註

EnableTheming屬性會指出是否已針對指定的控制項啟用主題。The EnableTheming property indicates whether themes are enabled for a specified control. 當屬性為true時,會搜尋應用程式的主題目錄,以供套用控制項的外觀。 EnableThemingWhen the EnableTheming property is true, the application's theme directory is searched for control skins to apply. 如果主題目錄中沒有特定控制項的面板,則不會套用任何外觀。If no skin for the particular control exists in the theme directory, skins are not applied.

當屬性為false時,不會搜尋主題目錄, SkinID也不會使用屬性的內容。 EnableThemingWhen the EnableTheming property is false, the theme directory is not searched and the content of the SkinID property is not used.

您可以在頁面、容器或控制項層級啟用主題。Themes can be enabled at the page, container, or control level. 控制項可以覆寫其EnableTheming父控制項或包含頁面所設定的值。A control can override the EnableTheming value set by its parent control, or by the containing page.

適用於

另請參閱