線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1742
推到 Plurk!
推到 Facebook!

如何改變 tstatusbar之特定 panel 之 font color

尚未結案
QOO10
初階會員


發表:59
回覆:89
積分:29
註冊:2002-12-25

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-02-27 11:28:07 IP:61.229.xxx.xxx 未訂閱
如主旨!!我查了相關問題如 http://delphi.ktop.com.tw/topic.php?topic_id=20131 但還是不懂請前輩救救我!!
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-02-27 12:10:01 IP:147.8.xxx.xxx 未訂閱
This is an example written in Delphi. The Style property of the Panels should be psOwnerDraw.    
procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
  Panel: TStatusPanel; const Rect: TRect);
begin
    with StatusBar.Canvas do begin
        Brush.Color := clYellow;
        case Panel.Index of
            0: Font.Color  := clBlack;
            1: Font.Color  := clBlue;
        else
            Font.Color  := clGreen;
        end;
        FillRect(Rect);
        TextRect(Rect,Rect.Left 1,Rect.Top 1,Panel.Text);
    end;
end;
QOO10
初階會員


發表:59
回覆:89
積分:29
註冊:2002-12-25

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-03-03 10:13:39 IP:61.229.xxx.xxx 未訂閱
引言: This is an example written in Delphi. The Style property of the Panels should be psOwnerDraw.
procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
  Panel: TStatusPanel; const Rect: TRect);
begin
    with StatusBar.Canvas do begin
        Brush.Color := clYellow;
        case Panel.Index of
            0: Font.Color  := clBlack;
            1: Font.Color  := clBlue;
        else
            Font.Color  := clGreen;
        end;
        FillRect(Rect);
        TextRect(Rect,Rect.Left 1,Rect.Top 1,Panel.Text);
    end;
end;
謝謝您!!
系統時間:2024-05-04 16:30:55
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!