Pictures on the toolbar

genu

Well-known member
Joined
Jun 9, 2005
Messages
94
Programming Experience
1-3
hi, im trying to get pictures on the toolbar...and for some readon they are not showing right...I made them gifs so I can have them be transparent but they have a blue line around them like in the screenshot
 

Attachments

  • sc.jpg
    sc.jpg
    14.1 KB · Views: 223
hey thx for your help JM...I just switched back to the listview control....I guess im not ready for the datagrid...lol....anyway..back to the original...whats the best format to use for toolbar icons...for some reason...i tried GIF, BMP and JPEG...and they show up in the designer but not when I run the program...what could be the problem?
 
If you have visual styles enabled and you have an ImageList component on your form, you have to call Application.DoEvents() before instantiating the form to have the images displayed. If you currently have a class called Form1 as your startup object, I would suggest using a Main procedure instead and putting this code in it:
VB.NET:
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New Form1)
People generally suggest putting your Main procedure in a module. This a good idea, but if I don't have any other need of a module then I don't create one just for the Main procedure. I declare it Shared and put it in my main form instead.

A good solution to the issues of using visual styles is to go to www.skybound.ca and download their free VisualStyles component. It overcomes pretty much all of the short-comings of Visual Studio when it comes to visual styles.
 
Last edited:
Back
Top