全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:3228
推到 Plurk!
推到 Facebook!

如何更改ShowMessage的字體

尚未結案
senix
一般會員


發表:28
回覆:25
積分:10
註冊:2002-03-15

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-04-29 12:30:02 IP:210.202.xxx.xxx 未訂閱
請教各位前輩~ 如何更改ShowMessage中訊息 的字體與大小...謝謝大家
william
版主


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

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-04-29 14:24:04 IP:147.8.xxx.xxx 未訂閱
No, I think there is no simple way to change the font unless you want to monitor window creation and chagne the font settings using the handle of the dialog. You should have a picture if your follow the code of ShowMessage found in Dialogs unit. An easier way is to create your own message dialog. 
Mickey
版主


發表:77
回覆:1882
積分:1390
註冊:2002-12-11

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-04-29 15:25:30 IP:218.163.xxx.xxx 未訂閱
改變 Message Dialog 字顏色為紅色 :
  with CreateMessageDialog('123',mtCustom, [mbOK]) do begin
    try
      font.Color := clred;
      Position := poScreenCenter;
      showmodal;
    finally
      free;
    end;
  end;
發表人 - Mickey 於 2003/04/29 15:28:57
timhuang
尊榮會員


發表:78
回覆:1815
積分:1608
註冊:2002-07-15

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-04-29 23:27:24 IP:61.221.xxx.xxx 未訂閱
Hi, 請參考這篇: http://delphi.ktop.com.tw/topic.php?TOPIC_ID=28515
liorex
初階會員


發表:19
回覆:60
積分:32
註冊:2002-08-20

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-04-30 17:17:13 IP:61.222.xxx.xxx 未訂閱
希望你能用的上
procedure TForm1.Button1Click(Sender: TObject);
var
 from : TForm ;
 lab : TLabel ;
begin
  from := CreateMessageDialog('afsdfadsfasd',mtInformation, [mbOK]);
  with from do
  begin
    lab := TLabel(FindComponent('Message')) ;
    if lab <> nil then
    begin
      lab.Font.Color := clRed ; //你要的顏色在這裡設
    end ;
    from.ShowModal;
  end;
  from.Destroy ;
  FreeAndNil(from);    end;  
---------------------- 一切有為法 如夢幻泡影 如露亦如電 應做如是觀 ----------------------
liorex
初階會員


發表:19
回覆:60
積分:32
註冊:2002-08-20

發送簡訊給我
#6 引用回覆 回覆 發表時間:2003-04-30 17:21:16 IP:61.222.xxx.xxx 未訂閱
希望你能用的上
procedure TForm1.Button1Click(Sender: TObject);
var
 from : TForm ;
 lab : TLabel ;
begin
  from := CreateMessageDialog('afsdfadsfasd',mtInformation, [mbOK]);
  with from do
  begin
    lab := TLabel(FindComponent('Message')) ;
    if lab <> nil then
    begin
      lab.Font.Color := clRed ; //你要的顏色在這裡設
      lab.Font.Size := 12 ;   //字體
      lab.Font.Name := '標楷體';//字型
    end ;
    from.ShowModal;
  end;
  from.Destroy ;
  FreeAndNil(from);    end;  
---------------------- 一切有為法 如夢幻泡影 如露亦如電 應做如是觀 ----------------------
ianyoung
一般會員


發表:1
回覆:4
積分:1
註冊:2002-08-16

發送簡訊給我
#7 引用回覆 回覆 發表時間:2004-03-08 09:43:52 IP:211.147.xxx.xxx 未訂閱
To liorex: 當字體設置變大的時候,Message窗體的大小不會隨之改變,字體會超齣Message窗體的邊界。 ------ ian ------
------

------
ian
------
系統時間:2024-04-29 20:36:10
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!