/*
OnDrawPanel, Canvas, Draw example
The following code is the OnDrawPanel event handler of a status bar.  It draws each panel of the status bar, adding text and icons stored in ImageList1. The image list contains as many icons as there are header sections.
*/ 
void __fastcall TForm1::StatusBar1DrawPanel(TStatusBar *StatusBar,
        TStatusPanel *Panel, const TRect &Rect)
{
  TCanvas *pCanvas = StatusBar->Canvas;
  pCanvas->Brush->Color = clRed;
  pCanvas->FillRect(Rect);
  pCanvas->Font->Color = clYellow;
  ImageList1->Draw(pCanvas,Rect.Left,Rect.Top, Panel->Index, true);
  pCanvas->TextOut(Rect.left + 30, Rect.top + 2, "Panel" + IntToStr(Panel->Index));
} 
