Theme working in design time but not at runtime

2 posts, 1 answers
  1. James
    James avatar
    22 posts
    Member since:
    Jun 2014

    Posted 23 Jan 2015 Link to this post

    I have a base form inherited from RadForm and in the constructor I added the following.

    Public Sub New()
        MyBase.New()

        ThemeResolutionService.ApplicationThemeName = "VisualStudio2012Dark"
        Me.ThemeName = "VisualStudio2012Dark"
    End Sub

    When I open the BaseForm in VisualStudio I can see that the form is "Dark" but when I run the application, the form is not "Dark".
    The titlebar font / icons did change from their original look "for example the X close button looks 3D" but they also did not take on the "Dark" theme.

    I have tried several of the other themes and they all working at design time but not runtime.
  2. Answer
    James
    James avatar
    22 posts
    Member since:
    Jun 2014

    Posted 23 Jan 2015 in reply to James Link to this post

    Nevermind. 
    It works if I call InitializeComponent()

    Public Sub New()
        MyBase.New()
       
        InitializeComponent()

        ThemeResolutionService.ApplicationThemeName = "VisualStudio2012Dark"
        Me.ThemeName = "VisualStudio2012Dark"
    End Sub
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top