Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB.NET Toolbar

Posted on 2004-08-22
7
Medium Priority
?
894 Views
Last Modified: 2008-03-06
Hi everyone.
I've upgraded a vb6 application to vb.NET
The quality of the images on the older toolbar & older imageList are great but if I create a new imageList and a New toolBar, the quality of the images on the new controls are lower !?
You can see the difference at:
http://users.domaindlx.com/kourosh/toolbar.jpg
I've loaded the same bitmaps...with the highest possible color depth (32dpi)

Also, do you know if I can put a control (like a progressBar or listBox) on a toolBar?
Feel free to comment.
0
Comment
Question by:kouroshparsa
  • 4
  • 3
7 Comments
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 11868430
Hello

  fhange the colorDepth property of ImageList to Depth24Bit or Depth32Bit

0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 11868442
>>fhange
sorry I meant Change
0
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 300 total points
ID: 11868835
I forgot the second part

you can add any control to tool bar by setting the Parent Property to the toolbar or add the control to Controls collection of toolbar as following:

        ToolBar1.Controls.Add(ComboBox1)
        ProgressBar1.Parent = ToolBar1
        ComboBox1.Top = 0
        ProgressBar1.Top = 0

HTH
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:kouroshparsa
ID: 11877792
Hi.
About the code above, do you know the difference between ToolBar1.Controls.Add(ProgressBar1)
and ProgressBar1.Parent = ToolBar1       ?

About the quality problem:
I made a new sample for myself and before adding images to the imageList, I set the colorDepth, Now it has its correct quality, but it causes another problem:
As far as I know, the Transparent color of the default Microsoft bitmaps (images of printer, cut, copty...) is Silver.
Now it does not work.
[keep in mind that imageList has a property TransparentColor and also the toolbar has that property in imageList property]
When I fix the Transparent color, the quality of the image noticably decreases!!!?

Please try to set the tranparent property of the imageList to silver before loading the images, otherwise it is not going to work at all. Maybe I'm wrong about the color "Silver" but it works in vb6 as Silver!
0
 
LVL 2

Author Comment

by:kouroshparsa
ID: 11878121
I figured that the problem was only with 3 images, so I edited the bitmaps...and now it looks much better.(The quality problem is solved)
I suggest anyone who may face this problem to edit the bitmaps or icons(if it does not look right) and choose Silver TransparentColor (for the Microsoft images) + ColorDepth before loading the images.
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 11878422
Hello kouroshparsa

>>ToolBar1.Controls.Add()
it's will add the control into the Toolbar controls collection and will change the Parent to ToolBar

>>ProgressBar1.Parent
will change the parent of ProgressBar to ToolBar, and ProgressBar will added to collection controls too

I gave you the two, for doing the same thing, but I prefer to use ToolBar1.Controls.Add because it's more clear

>>Please try to set the tranparent property of the imageList to silver
you can use any color not onll silver, I have Icons with background Magenta, so I just choose the transparent color for the ImageList

HTH

Regards,
Mohammed
0
 
LVL 2

Author Comment

by:kouroshparsa
ID: 11889136
Thanks for commenting on "the difference between add & parent".
I sure knew that I can choose any transparent color...I was talking about the common bitmaps of Microsoft with Silver transparent color at "\common\graphics\bitmaps"...What surprised me was that the same bitmap in vb6 looks different on vb.NET.
Well, as I said I fixed the problem by editing it.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month12 days, 3 hours left to enroll

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question