請問ShowMessage的問題 |
答題得分者是:deal
|
billlee
一般會員 發表:31 回覆:46 積分:15 註冊:2002-06-25 發送簡訊給我 |
|
deal
一般會員 發表:6 回覆:33 積分:22 註冊:2003-04-07 發送簡訊給我 |
|
billlee
一般會員 發表:31 回覆:46 積分:15 註冊:2002-06-25 發送簡訊給我 |
|
axsoft
版主 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
billlee:您好: ShowMessage的BCB原型定義如下:
extern PACKAGE void __fastcall ShowMessage(const AnsiString Msg); 在Dialogs.pas中是這樣定義的:
procedure ShowMessage(const Msg: string); begin ShowMessagePos(Msg, -1, -1); end; procedure ShowMessagePos(const Msg: string; X, Y: Integer); begin MessageDlgPos(Msg, mtCustom, [mbOK], 0, X, Y); end; function MessageDlgPos(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer): Integer; begin Result := MessageDlgPosHelp(Msg, DlgType, Buttons, HelpCtx, X, Y, ''); end; function MessageDlgPosHelp(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer; const HelpFileName: string): Integer; begin with CreateMessageDialog(Msg, DlgType, Buttons) do try HelpContext := HelpCtx; HelpFile := HelpFileName; if X >= 0 then Left := X; if Y >= 0 then Top := Y; if (Y < 0) and (X < 0) then Position := poScreenCenter; Result := ShowModal; finally Free; end; end;看了以上的陳述,您應該可以自訂一個自己的ShowMessage喔!... Delphi.Ktop風紀小隊---[ 發問前請先找找舊文章 ]--- 發表人 - axsoft 於 2003/05/13 12:09:54 |
billlee
一般會員 發表:31 回覆:46 積分:15 註冊:2002-06-25 發送簡訊給我 |
引言: billlee:您好: ShowMessage的BCB原型定義如下: extern PACKAGE void __fastcall ShowMessage(const AnsiString Msg); 在Dialogs.pas中是這樣定義的:謝謝你,竟然可以了解的那麼透徹,我已用MessgaeBox來達成我的要求procedure ShowMessage(const Msg: string); begin ShowMessagePos(Msg, -1, -1); end; procedure ShowMessagePos(const Msg: string; X, Y: Integer); begin MessageDlgPos(Msg, mtCustom, [mbOK], 0, X, Y); end; function MessageDlgPos(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer): Integer; begin Result := MessageDlgPosHelp(Msg, DlgType, Buttons, HelpCtx, X, Y, ''); end; function MessageDlgPosHelp(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer; const HelpFileName: string): Integer; begin with CreateMessageDialog(Msg, DlgType, Buttons) do try HelpContext := HelpCtx; HelpFile := HelpFileName; if X >= 0 then Left := X; if Y >= 0 then Top := Y; if (Y < 0) and (X < 0) then Position := poScreenCenter; Result := ShowModal; finally Free; end; end;看了以上的陳述,您應該可以自訂一個自己的ShowMessage喔!... Delphi.Ktop風紀小隊---[ 發問前請先找找舊文章 ]--- 發表人 - axsoft 於 2003/05/13 12:09:54 |
hagar
版主 發表:143 回覆:4056 積分:4445 註冊:2002-04-14 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |