Solved

VB.NET Toolbar

Posted on 2004-08-22
7
850 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 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now