Windows XP visual styles

  • Thread starter Thread starter Mehrdad Afshari
  • Start date Start date
M

Mehrdad Afshari

Hi,

How can I use windows XP visual styles without an external manifest file in
a C# windows application (I'm using VS.NET 2003)

Thanks in advance
 
Hi Mehrdad,

Starting with .NET Framework 1.1, you can use Application.EnableVisualStyles
(call Application.DoEvents() right after this)

Also, make sure your UI elements have the property FlatStyle set to System,
otherwise they won't use the XP Styles (by default they are set to
Standard).

HTH,

--
Vasco

The future of VS.NET
http://msdn.microsoft.com/vstudio/productinfo/roadmap.aspx

This posting is provided "AS IS" with no warranties, and confers no rights.
 
DO NOT USE THIS SUGGESTION!!!!!!!!

You'll break your application royally with the worst type of bugs (random
ones!) and they're all completely not debugable because they're low level
ones that are outside the debug environment of .Net. (i.e. WndProc errors
and "General Windows Errors".

The .DoEvents() gets rid of the artifacts that you get with ImageLists etc,
but it will cause all kinds of other issues later on.

The only way to do it and have no problems with it is to use a manifest
file. Whidby (next version of VS.net) fixes this finally.

MS, since your own development people have admitted that
EnableVisualStyles() is completely and irrevicobly broken in Vs.net 2003,
you shouldn't be giving out advice like this.

James Hancock
 
Houch James, thanks for the disclaimer :)

I'm just presenting a route.

I totally agree and accept your reminder. The better route would be the
manifest, and embedd it within the file (that way there's no external
manifest)

Using Windows XP Visual Styles With Controls on Windows Forms
http://msdn.microsoft.com/library/d...ylesWithControlsOnWindowsForms.asp?frame=true

Creating a Visual Studio .NET Add-In to provide Windows XP Theme Support
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnperfmo/html/xpthemeaddin.asp

Thx

--
Vasco

The future of VS.NET
http://msdn.microsoft.com/vstudio/productinfo/roadmap.aspx

This posting is provided "AS IS" with no warranties, and confers no rights.
 
I tried this add in and opted to disable it. It has the annoying side effect
than when it is installed whenever you use a LABEL control on your design,
it will totally ignore the label's text alignment setting and default it to
top-left.
 
Back
Top