Very intresting button image problem

gesus

New member
Joined
Sep 6, 2004
Messages
4
Location
Amsterdam
Programming Experience
1-3
Hi,

I've got a little nice problem, hope someone can help..

Ive got a toolbar, with buttons on it and image's (icon's) in it.

But when i use the "EnableVisualStyles" function, the images are gone and I only see a "naked" button..

Does someone know why this is happening?
Thanks in Advance
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,292
Location
Sydney, Australia
Programming Experience
10+
The dodos at MS have made several glaring oversights in visual style support in VS.NET, including the fact that the NumericUpDown class does not support visual styles at all, which is annoying, and a lack of image support on buttons. This lack of image support does not, however, extend to toolbar buttons. There is mention in the VS.NET help, in the article entitled "Applying Windows XP Visual Styles to Windows Forms Applications" that "if one of the controls on your form is an ImageList control, be sure to include the following line of code before calling Application.Run()".

Application.DoEvents()

This should solve your problem.

By the way, I found a button component that supports images with visual styles at www.wiseworx.com for anyone who is interested.
 
Last edited:

gesus

New member
Joined
Sep 6, 2004
Messages
4
Location
Amsterdam
Programming Experience
1-3
Hi jmcilhinney,

I've tried and it worked..
Many, many thanks, this solves a big problem for me!
 
Top Bottom