EnableVisualStyles not working

E

Evans3

I'm creating a program on a windows XP SP2 machine using visual studio
2005 standard edition with .net framework 2.0. Even when I enable
visual styles the simple form looks like windows 2k not windows XP.
The program looks the same whether or not EnableVisualStyles has been
run. Very simple issue and any suggestions would be appreciated.
Below is the code:

using System;
using System.Drawing;
using System.Windows.Forms;

class StudentTeaching : Form
{
[STAThread]
public static void Main()
{
Application.EnableVisualStyles();
Application.Run(new StudentTeaching());
}

public StudentTeaching()
{
Text = "Student Teaching";
AutoSize = true;
//AutoSizeMode = AutoSizeMode.GrowAndShrink;

Button btn = new Button();
btn.Parent = this;
btn.Text = "test";
//btn.FlatStyle = FlatStyle.System;
}
}
 
M

Mehdi

I'm creating a program on a windows XP SP2 machine using visual studio
2005 standard edition with .net framework 2.0. Even when I enable
visual styles the simple form looks like windows 2k not windows XP.
The program looks the same whether or not EnableVisualStyles has been
run. Very simple issue and any suggestions would be appreciated.

Are you using a windows theme that supports visual style (the windows XP
style not the Windows classic style)? Have you set the FlatStyle properties
of all the controls that have this property to System?
 
E

Evans3

That was the issue. My display theme on the computer was set on some
modified setting instead of Windows XP. Thanks for your help!
 

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