IT:AD:ASP.NET:Win Forms:Theming

* THemes take precedence over local control settings *

  MyWebSite
    App_Themes
      BlueTheme
        Controls.skin
        BlueTheme.css
      PinkTheme
        Controls.skin
        PinkTheme.css

* In the .skin file, add a normal control definition by using declarative syntax, but include only the properties that you want to set for the theme. * The control definition must include the runat=“server” attribute * The control must not include the ID=“” attribute. * The control can have a SkinID

  • SkinID is used to for specifically named control matching.
Protected Sub Page_PreInit(ByVal sender As Object, _
    ByVal e As System.EventArgs) _
    Handles Me.PreInit
  Select Case Request.QueryString("theme")
    Case "Blue"
        Page.Theme = "BlueTheme"
    'Page.StyleSheetTheme = ...
    Case "Theme2"
        Page.Theme = "PinkTheme"
    'Page.StyleSheetTheme = ...
  End Select

End Sub

<configuration>
  <system.web>
    <pages theme="xxx" styleSheetTheme="Themename" />
  </system.web>
</configuration>

There are two tags…Theme and StyleSheetTheme.
Theme has precendence over Control.
StyleSheetTheme is set first, and lets Control override it.

  • /home/skysigal/public_html/data/pages/it/ad/asp.net/win_forms/theming.txt
  • Last modified: 2023/11/04 03:37
  • by 127.0.0.1