Images does not show on toolbar button at runtime

D

Dotnetjunky

Hi,

I encountered a very strange behavior in my WinForms app
today (I used VB.NET.) I have a Toolbar control, which is
associated with an ImageList control. Each button on the
toolbar points to a corresponding image of the ImageList.
At design time, VS.NET shows the images on toolbar
buttons properly; but at runtime, all the images
disappear, leaving me blank buttons.

Anybody knows the cause of this problem ?

Thanks in advance.

Kinh Luan
 
H

Herfried K. Wagner [MVP]

* "Dotnetjunky said:
I encountered a very strange behavior in my WinForms app
today (I used VB.NET.) I have a Toolbar control, which is
associated with an ImageList control. Each button on the
toolbar points to a corresponding image of the ImageList.
At design time, VS.NET shows the images on toolbar
buttons properly; but at runtime, all the images
disappear, leaving me blank buttons.

If you are using Windows XP Visual Styles, call 'Application.DoEvents'
directly after calling 'Application.EnableVisualStyles'.
 
D

Dotnetjunky

thanks a lot, that works. ;)

And one more question also regarding images on toolbar
buttons. How can I make a portion of the images
transparent ?

Happy New Year

Dotnetjunky
 
H

Herfried K. Wagner [MVP]

* "Dotnetjunky said:
And one more question also regarding images on toolbar
buttons. How can I make a portion of the images
transparent ?

Have a look at the imagelist's 'TransparentColor' property.
 

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