Geeks With Blogs

Tim Huffam Dotting the I and crossing the T of I.T.

Ever wondered why your winforms app looks good (ie shows Windows XP type styling) in the Visual Studio designer (VS2005) yet when you run it, it looks very Windows 2000 (not very colorful and no rounded corners)?

That's because by the XP styling is turned off by default.  To enable it, include the following line in your form's constructor:

    System.Windows.Forms.Application.EnableVisualStyles();

Simple when you know huh.

HTH

Tim

Posted on Monday, November 20, 2006 1:41 PM C# .NET | Back to top


Comments on this post: Enabling XP visual styles in your .NET winforms app.

# re: Enabling XP visual styles in your .NET winforms app.
Requesting Gravatar...
It does not worked.
Left by Ashik Iqbal on Aug 16, 2007 5:25 AM

# re: Enabling XP visual styles in your .NET winforms app.
Requesting Gravatar...
Is this relevant anymore? I mean does it apply to .Net 1.0 only?
Left by Paul Mortlock on Jun 20, 2012 8:06 AM

Your comment:
 (will show your gravatar)


Copyright © Tim Huffam | Powered by: GeeksWithBlogs.net