You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
anarchie347 edited this page May 15, 2023
·
2 revisions
Creating a themeable form
To make your form work with themeable controls, you must make it inherit from Anarchie.Themes.ThemeableForm
If you are using Visual Studio, then at the top of Form1.cs, change
publicpartialclassForm1:Form
to
publicpartialclassForm1:ThemeableForm<Theme>
Replace Theme with whatever Theme schema you are using. It must inherit from Theme
and add
using Anarchie.Themes
to the top of the file
Doing this will mean that the designer tool in visual studio will no longer work.
Now go to the constructor method, and change
publicForm1(){//code}
to
publicForm1():base(DefautTheme){//code}
Replace DefaultTheme with whatever theme the program will use to begin with.
To change the theme later, edit the CurrentTheme property of the ThemeableForm.