XP visual style

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

http://msdn.microsoft.com/library/d...apedWindowsFormsControlsInVisualStudioNET.asp


I've tried everything in the article
http://msdn.microsoft.com/library/d...apedWindowsFormsControlsInVisualStudioNET.asp

with NO luck.

I've tried this on 2003 server and 2003 XP.

Also.
1) added Application.EnableVisualStyles(); before .run
2) private void RecursivelyFormatForWinXP(Control control)
3) if(Environment.OSVersion.Version.Major > 4
& Environment.OSVersion.Version.Minor > 0
& System.IO.File.Exists(Application.ExecutablePath + ".manifest"))

All seems to execute during debug, but NO visual changes.

Any ideas?
 
I re-checked the article and found a mistake in my execution. I added the
manifest resource to the wrong .EXE.

I did the import to the .OBJ\DEBUG .EXE and now it is permanent in the
compiled .EXE.

But, still NO XP style on any of my forms.

Once, again. Any ideas?
 
1) added Application.EnableVisualStyles(); before .run
2) private void RecursivelyFormatForWinXP(Control control)
3) if(Environment.OSVersion.Version.Major > 4
& Environment.OSVersion.Version.Minor > 0
& System.IO.File.Exists(Application.ExecutablePath + ".manifest"))

I'm not clear on what you are attempting to do. Are trying to get the XP
look and feel on your controls? Or are you trying to create an irregularly
shaped form using a region?

For the first,

Add

Application.EnableVisualStyles
Application.DoEvents '<------ Important to work around a bug

Make sure all of your controls have their FlatStyle property set to System.



For the region, create an instance of the GraphicsPath class. Use its
various methods to create your shape. Then create a region object from the
GraphicsPath and assign that region to the form or control:

Dim gp As New GraphicsPath

gp.AddEllipse(Me.ClientRectangle)

Dim rgn As New Region(gp)

Me.Region = rgn


HTH


--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
Hi Gary,

I believe you need to install the XP Theme on Windows 2003 before the XP
style is visible.
 
Back
Top