Pictures in Statusbar

I am using the statusbar control that comes with VB.

No matter where I get the picture from to show in one of the panels (be it from a picture loaded from a picturebox or from loaded from a res file) the statusbar messes with the image stretching it and or messing with the colours.

Does any one know a way of consistently being able to load pictures into a statusbar panel without any distortions or loss of colour?

NB the pictures/Icons I am working with are 16x16 as I thought this would be a reasonable/standard size.

(I have heard it rumoured that the API routine LoadImage might provide a solution........and I have got it to provide a handle to the icon in my res file......but where from here. However if your solution is different but works just as well - then heck to the LoadImage function.)


Who is Participating?

Improve company productivity with a Business Account.Sign Up

PBuckConnect With a Mentor Commented:
I have yet to try loading a picture from a .res file, so I am not sure if my suggestion will make a difference.  But I usually use a ImageList and load my various icons, bmps and gifs.  I use "slide show" icons to display a wait cycle within the statusbar and they seem clear and maintain their color.

StatusBar1.Panels(1).Picture = ImageList1.ListImages(iPIC).Picture

The ImageList seems to maintain the image quality when linked to other controls that your using.  It is worth a try if you have not already.
I dont think the method you use for loading makes any difference.. it is the height of the statusbar. If you have 16x16 pixel icons try setting the toolbar height to 315 twips.

I dont know of any way of getting 16x16 icons in their correct aspect ratio without having the statusbar set to the right height.

The vbAccelerator site has a great example using their "no-status bar status bar class" that you can use icons within.

It's a great site to know about in any case (

For the status bar, try:

The third example is the simplest solution, but the others are interesting as well.

Hope this helps
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Is this really a definitive answer Ask_Ed ?

I would remind you that you shouldnt lock a question unless you are confident that your answer is the definitive one, otherwise some experts will not look at the question and potentially valuable information may be lost.

Answers like yours should only be comments - it is still possible for the questioner to award you the points if your answer fits.
holgraveAuthor Commented:
I have tried VbAccelerator's control but it has a number of bugs (more than the Microsoft control) that make it unsuitable.

The main bugs are:

1) The gripper bar allows a resizing rectangle to appear if gripped and dragged - even when the window is Maximized (pooh - this is because the statusbar window is created in usercontrol....even when maximized as far as the statusbar window is concerned in its user control it isn' easily solved....create the window independantly of the user control.......I have done this but this doesn't solve the next problems)

2) When used with several controls ono a form the statusbar has problems repainting itself.

3) If a TabControl is used in the same app. as the statusbar and a windowless control (eg. label) is assigned as a child to the tabcontrol (set parent) at runtime then the statusbar disappears. Can be slightly eased by setting ClipControls = True. But still flickers and is very slow to redraw. LockWindowUpdate is only a partial solution.

Obviously I would still like to do away with the Microsoft statusbar to do away with the need for Commctrl.ocx - but there isn't a robust alternative.

And yes I have tried the CCRP statusbar - but this suffers from exactly the same problems as the VBAccelerator control in respect of 1. and 2. Not surprisingly because it has been created in a very similar manner being breed from the same class.

Thanks for the input though - but I agree with paulstamp - please don't lock a question unless you are positive you have a definitive answer.
There is nothing lost to you by posting it as a comment - but to me it potentially loses alternative answers.

holgraveAuthor Commented:
Thanks, I will try it. And let you know.



Sorry to polute this thread with a side comment, but I can not find where this type of issue should be raised and since the comment was made here ...

As a new user I am very surprised by your comment and paulstamps about my responding to your question as an ANSWER instead of a comment. My attempt to respond to your question is an answer, a valid one that did solve your initial problem of icons in the status bar, but granted may have other issues and side effects that you found undesirable and rejecting the answer is acceptable.

The problem that I see is:

Are we treating comments as answers and answers as the only solution, because the board needs to be redesigned to better suit its purpose?

From an outsiders view:

Comments are: Questions to clarify the situation or suggestions such as PBuck's above.

Answers are: Solutions believed (and hopefully tested) by the expert to resolve the initial problem/question. And as always, there are many ways to complete any task so many different answers can be supplied.

If the board doesn't function properly when Answers are returned, I'd atleast recommend that the Answer option from this page be removed as it severely hinders the user from obtaining the desired feedback.

What are your thoughts and how do we contact the group designing this site to make some design recommendations ?


holgraveAuthor Commented:
I was hoping for an answer that explained the use of the LoadImage API function as this is the only thing that appears to work with icons loaded from res files, otherwise the statusbar stretched the image.

holgraveAuthor Commented:
Hi Ed,

I agree with you that the system on Experts Exchange isn't perfect.

The Outsiders View you put forward was initially how Experts Exchange envisioned it - however this way is seriously flawed.

Thus users have evolved there own system.

The original way means that I could for example pose a question on Monday at 12:00 - someone could then post an Answer at 1:00. Unless this is a definitive answer this is no use to me and all other experts with possible answers have been locked out. I am bound to reject this answer on the grounds of wanting to open up the question to everyone - whether or not the answer is good or not. I guess I would be holding out for a definitive answer. In my case I would consider a definitive answer to be fully tested code that is know to definately solve the posed question. I would automatically reject an EARLY Answer that didn't have this content. On the other hand if the question had been open for a couple of days  - because by this point I would have expected those that did of have an Answer to the problem to have come forward by then.

I have nothing against you giving Answers - but in this case I think your timing was a little off.
(As a side point if you check the times of the postings you actually answer my question before I posed it - which is a fairly neat trick......may be you should be given some points for just this! - I for one am quite impressed)

So any way to wrap this up:

I believe that the unwritten rules of conduct have evolved.

I believe that an Answer should not be given until at least two days have elapsed.

Answers should be treated as definitive answers.

Comments are a mechanism not only for posting comments - but for proposing answers - especially in the two day amnesty.


May be a new thread/discussion should be started on Community.

Hi Hol,

Thanks for the information and your time.

Your interpretation of the unwritten rules seams to be a good one to follow. I'll try to do that.

I do think that only the person asking the question can determine what a "definitive answer" to their question is, as there is always more to the situation than what gets posted as the question.

Bye for Now and
Take care
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.