EnableVisualStyles - Release

  • Thread starter Thread starter Christian Westerlund
  • Start date Start date
C

Christian Westerlund

Hi!

I usually enable visual styles in my apps. I do it in Main before I
start my app with Application.Run.
Today when I changed from debug to release mode in Visual Studio .NET
2003, the XP-style disappeared when I ran the app.
I changed back to debug mode but I couldn't get the more appealing
XP-style back.

I even created a new solution and projects and manually copied my files
to the new location but it wouldn't change back.

Has anyone run into this problem before??

/Christian
 
Christian,
Did you call Application.DoEvents also?

Application.EnableVisualStyles();
Application.DoEvents();
Application.Run(...);

Are you certain you did not delete the EnableVisualStyles line?

Hope this helps
Jay
 
Hi Jay!

Thanks for the help, I didn't do DoEvents().
Wy must i have that line there for it to work when it worked fine earlier?

Thanks again!

/Christian
 
Christian,
There are a handful of "bugs" in EnableVisualStyles, that calling DoEvents
seems to fix.

The biggest "bug" I know of is that tool bar button images do not (may not)
display. I understand there are a couple of other minor issues with it... I
use DoEvents, currently I have not seen any of the issues...

Hope this helps
Jay
 
Jay B. Harlow said:
Christian,
There are a handful of "bugs" in EnableVisualStyles, that calling DoEvents
seems to fix.

How that function ever made it past testing and into the real world is a
mystery. DoEvents will fix the obvious bugs and leave you with just the
painful non-obvious ones. I'd use a manifest instead, and avoid trouble in
the future.
 

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

Back
Top