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: 224
and just out of curiosity...this program uses a text based database to store information...and in the screenshot u see filters....which is the best way to filter the data.....? the only way I can think of is to requery the textfile everytime....is this the simplest way?
 
For the images, you probably need to adjust the ColorDepth property of your ImageList. As for filtering, I'd suggest that you put your data into a DataTable and then use the RowFilter and/or RowStateFilter properties of the DefaultView property. The DefaultView property of a DataTable is a DataView, which has a Sort property as well as the filter properties. You would then bind to, or display data from, the tables DefaultView property instead of the DataTable itself. If you have lots of related tables, the DefaultViewManager is to a DataSet as the DefaultView is to a DataTable.
 
I used to have the same problem too when using GIF. I think it is because GIF has a limitation of 256 colors only. To get a better result, you may use PNG, however you cannot set the background transparent. What I normally do, is to color the background the same color as the form itself.

However, trouble will arise when users are not using the same desktop color scheme...
 
ayozzhero.....I did the same thing...but u are right...it looks bad on descktops with different themes....so wahts the solution?
 
Probably what we need to do is to override Windows color scheme and color the form manually or use web colors. I never tried this, but I think it won't be affected by user's Window color scheme.
 
By the way, just asking... how do you change your status to 'VB.NET Forum Enthusiast'? I mean, my status keeps changing and I can't find a way to set it. I've seen certain strange status on certain members such as 'Paranormal Investigator' but I do not know how to do that. (Sorry if this is out of topic)
 
genu said:
ayozzhero.....I did the same thing...but u are right...it looks bad on descktops with different themes....so wahts the solution?
Use proper icons with alpha-blending instead of GIFs.
 
hey jmcilhinney.... thanks for pointing out the filterting options...so here is what I did: I added the DataSet control and the DataView control...but how do I go about adding items to the data?...this is the first time I use these...so still kind of new to me.

also when u say use proper icons iwht alpha-blending...I used Macromedia fireworks to export those..do I need a different program?
 
I don't know exactly how you are displaying your data, but to add a new row to a table, you call the NewRow method of the DataTable to get a new DataRow object. You then set each field of the row as you want and then call the Add method of the DataTable's Rows property, which is a DataRowCollection. So, the steps are create, populate and add.
VB.NET:
Dim myDataRow As DataRow = myDataTable.NewRow()

myDataRow("field1") = value1
myDataRow("field2") = value2
myDataTable.Rows.Add(myDataRow)

As for your icons, I take it that increasing the colour depth of your ImageList didn't work because of the GIFs. There are various specialist icon creation packages around, like Microangelo or IconWorkshop, that allow you to create the new WinXP style icons with transparency. I don't know what Fireworks' capabilities are in that regard. I'm no expert when it comes to image-related things, so I'm just making suggestions that I think should work.
 
hey...for some reason....the toolbar doesnt show the images (GIFS) because I decided to just use the gifs but not transparent but it shows them in the designer, but when I run the application the Toolbar doesnt show the icons.
 
Back
Top