Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Images on status bar?

Status
Not open for further replies.

DirkDiggler

Programmer
Jul 1, 2001
3
SE
How do I add a small bmp-image at the rightmost end of a TStatusBar? Is it possible at all?
 
Yes it is possible. I created a status bar and split it into parts. On one part, I dropped a TImage component and selected a bmp to display in it. Then I dropped the following code into the status bar's OnDrawPanel method.
Code:
TCanvas *pCanvas = StatusBar->Canvas;

pCanvas->Brush->Color = clRed;

pCanvas->FillRect(Rect);
pCanvas->Font->Color = clYellow;
ImageList1->Draw(pCanvas,Rect.Left,Rect.Top, Panel->Index);
// pCanvas->TextOut(Rect.left + 30, Rect.top + 2, "Panel" + IntToStr(Panel->Index));

This code came from my help files under "status bars:drawing surfaces." I modified it a little. This is a start. You will have to play around with your code to get is to display where and how you want.
James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top