1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| void __fastcall TForm2::StatusBarDrawPanel(TStatusBar *StatusBar,
TStatusPanel *Panel, const TRect &Rect)
{
if(Panel == StatusBar->Panels->Items[0] ){ // cas ou on veut dessiner sur le panel 1 uniqument
String Texte = StatusBar->Panels->Items[0]->Text;
int X = Rect.Left;
int Y = Rect.top +Rect.Height()/2 - (ImageList->Height/2);
ImageList->Draw(StatusBar->Canvas, X, Y, 0) ;
StatusBar->Canvas->Brush->Style=bsClear;
X = Rect.Left+ImageList->Width+4;
Y = (Rect.Top+Rect.Height()/2)-(Canvas->TextHeight(Texte)/2);
StatusBar->Canvas->TextOutA(X,Y,Texte); //<-----
}
} |