Solved

VB.NET Toolbar

Posted on 2004-08-22
7
871 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 100 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
Industry Leaders: 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

Industry Leaders: 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!

Question has a verified solution.

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

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 …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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