Use the current Windows Theme/style

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...
 
T

Tasos Vogiatzoglou

Application.EnableVisualStyles();
Application.DoEvents();
Application.Run(yourFormContext);

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top