Use the current Windows Theme/style

  • Thread starter Thread starter James Alba
  • Start date Start date
J

James Alba

Hi all, being new to C# (not to C++), when I create a windows form and run
it, regardless if the windows operating system is using the "new" XP theme
or the "old" 95/98/2000 styled theme, my forms use the old 95/98 style
theme.

How do I get the new XP "look and feel" theme for my buttons and tab panes
and other controls? You know, the one where if you hover the mouse over
button, a thin yellow line at the base appears.

Using MFC / win32 API, I would add a manifest xml file.

What do I do in C#? And is there an online tutorial / sample?

Thanks all in advance...
 
Application.EnableVisualStyles();
Application.DoEvents();
Application.Run(yourFormContext);

before loading the form and set the components' FlatStyle property to
"System".
 
Back
Top