将StatusBar的SimplePanal设为False,双击StatusBar以在StatusBar中加入Panel将StatusBar中要显示图标的Panel的Style设为自绘,然后用一个ImageList装入图标,然后在StatusBar的DrawPanel事件如像下面这样写!procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar; Panel: TStatusPanel; const Rect: TRect);
begin
with StatusBar1.Canvas do
begin
Brush.Color := clRed;
FillRect(Rect);
Font.Color := clYellow;
ImageList1.Draw(StatusBar1.Canvas,Rect.Left,Rect.Top,Panel.Index);
TextOut(Rect.left + 30, Rect.top + 2, 'Panel' + IntToStr(Panel.Index));
end;
end;
begin
with StatusBar1.Canvas do
begin
Brush.Color := clRed;
FillRect(Rect);
Font.Color := clYellow;
ImageList1.Draw(StatusBar1.Canvas,Rect.Left,Rect.Top,Panel.Index);
TextOut(Rect.left + 30, Rect.top + 2, 'Panel' + IntToStr(Panel.Index));
end;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货