This is a migrated thread and some comments may be shown as answers.

Theme working in design time but not at runtime

1 Answer 86 Views
Form
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 24 Jan 2015, 01:50 AM
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.

1 Answer, 1 is accepted

Sort by
0
Accepted
James
Top achievements
Rank 1
answered on 24 Jan 2015, 01:54 AM
Nevermind. 
It works if I call InitializeComponent()

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

    ThemeResolutionService.ApplicationThemeName = "VisualStudio2012Dark"
    Me.ThemeName = "VisualStudio2012Dark"
End Sub
Tags
Form
Asked by
James
Top achievements
Rank 1
Answers by
James
Top achievements
Rank 1
Share this question
or