App.EnableVisualStyles kills my Toolbar icons

M

Mark D. Richter

I am calling Application.EnableVisualStyles() before
calling Application.Run() as prescribed.

I have a Toolbar control docked at the top of the main
program's window. This control is attached to an
ImageList control set for 16x16 bit icons.

When the main window displays there are no icons
displayed on the toolbar buttons.

If I run the app without calling EnableVisualStyles the
toolbar button icons display properly.

Any ideas?

Thanks.
 
J

Jay B. Harlow [MVP - Outlook]

Mark,
There is a buglet in the Application.EnableVisualStyles, you need to follow
it by Application.DoEvents for it to fully work.

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

Some people have better mileage with the manifest method (ala 1.0).

Hope this helps
Jay
 

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

Top