Application.EnableVisualStyles()

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

Guest

Hello all,

I just saw Application.EnableVisualStyles(); in the latest MSDN TV and
wanted to try it on my app.

I have a Toolbar with buttons and graphics. With the EnableVisualStyles()
the graphics on the buttons don't show anymore. Is there something I need to
do?

Thanks.
 
I think the current implementation of EnableVisualStyles() is a bit buggy. I
started getting a lot of exceptions after i used it. You can search the
newsgroups for similar problems, a common fix seems to be to run
Application.DoEvents() after calling EnableVisualStyles

like so

Application.EnableVisualStyles();
Aplication.DoEvents();
Application.Run(new MainForm());

try it out, might work for you.
 
Instead of using the mscorlib 6 controls; consider using 3rd party controls
from e.g. DevEx or Infragistics.

If your app is anything more than basic, it'll save you a lot of time.

Regards,
// Martin R-L
 
The Application.DoEvents() fix (my idea in the first place), fixes the
ImageList problem, however it doesn't fix the random crashing.

The only way to theme stuff in .net properly is to use a manifest file with
your exe. Even then, tab controls don't have themed tab pages, tab controls
don't appear correctly when aligned in any position other than top,
Groupboxes don't theme correctly when set to transparent, checkboxes have
the same problem as groupboxes, and Buttons don't allow images and text at
the same time (even if they did, they align the text incorrectly over the
image, which is stupid)

All of this is fixable, but a pain in the ass. Here's hoping that get all
of this fixed for Vs.net 2005....

I do have a set of updated controls that fix all of these issues. I'm
wondering if there is enough interest for me to release them to the General
Public....?

James Hancock
 
I also have a set of themed controls that fix those issues. They don't
require the use of EnableVisualStyles or a manifest, but I don't think they
are quite ready for commercial release. Maybe in a month or two.

-Eric
http://www.origincontrols.com
 
Back
Top