Solved

VB.NET Toolbar

Posted on 2004-08-22
7
843 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:mnasman
ID: 11868430
Hello

  fhange the colorDepth property of ImageList to Depth24Bit or Depth32Bit

0
 
LVL 22

Expert Comment

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

Accepted Solution

by:
mnasman 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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:mnasman
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 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

19 Experts available now in Live!

Get 1:1 Help Now