procedure TFrm.StatusBar1DrawPanel(StatusBar: TStatusBar; Panel: TStatusPanel; const Rect: TRect); var STR: string; imageindex: integer; begin if not xxxx then exit; with StatusBar do begin if myflag then begin imageindex := 0; statusbar1.Hint := '连机状态'; end else begin imageindex := 1; statusbar1.Hint := '断开连接'; end; ImageList1.Draw(Canvas, Rect.Left + 5, Rect.Top + 1, imageindex); end; end;
Panel: TStatusPanel; const Rect: TRect);
var
STR: string;
imageindex: integer;
begin
if not xxxx then exit;
with StatusBar do
begin
if myflag then
begin
imageindex := 0;
statusbar1.Hint := '连机状态';
end
else begin
imageindex := 1;
statusbar1.Hint := '断开连接';
end;
ImageList1.Draw(Canvas, Rect.Left + 5, Rect.Top + 1, imageindex);
end;
end;
放一个图片框,再放一个按钮写文字不就搞定了吗?