tag:blogger.com,1999:blog-6698224.post-1080780631602253202004-03-31T18:38:00.000-06:002004-08-11T10:07:03.126-05:00Enabling XP Visual Style in Windows Forms<span style="font-family:trebuchet ms;"><span style="font-size:85%;">Back to the .NET Framework version 1.0, the requirement to enable Windows XP Visual Style in a Windows Forms Application was a little dull, adding a xml manifest file into the application resources (opening the assembly from VS.NET). Now in .NET Framework version 1.1, you just need to call the static method <strong>Application.EnableVisualStyles</strong> just before calling the method Application.Run in your Main method:</spam>
<br /></span>
<br /></span><span style="font-family:trebuchet ms;"><span style="font-size:85%;"><span style="font-family:arial;">static void Main()
<br />{
<br /> Application.EnableVisualStyles();
<br /> Application.Run(new frmMainForm());
<br />}</span></spam> </span></span>
<br /><span style="font-family:trebuchet ms;">
<br /></span><span style="font-size:85%;"><span style="font-family:trebuchet ms;">You also need to change the standard flat sytle of all the Button controls in your form to FlatSytle.System:
<br /><em>btnSubmit.FlatStyle = System.Windows.Forms.FlatStyle.System;</em>
<br />
<br />Of course, you need any Windows XP version or above.</spam></span></span>
<br />Danielhttp://www.blogger.com/profile/17636031092965440114noreply@blogger.com