MessageDlg
1.MessageDlg function
在屏幕中間顯示一個消息對話框
Displays a message dialog box in the center of the screen.
function MessageDlg(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons;
HelpCtx: Longint): Word;
type TMsgDlgType = (mtWarning, mtError, mtInformation, mtConfirmation, mtCustom);
type
? TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, mbAll,
mbNoToAll, mbYesToAll, mbHelp);
? TMsgDlgButtons = set of TMsgDlgBtn;
const
? mbYesNoCancel = [mbYes, mbNo, mbCancel];
? mbYesAllNoAllCancel = [mbYes, mbYesToAll, mbNo, mbNoToAll, mbCancel];
? mbOKCancel = [mbOK, mbCancel];
? mbAbortRetryIgnore = [mbAbort, mbRetry, mbIgnore];
? mbAbortIgnore = [mbAbort, mbIgnore];
begin
? if MessageDlg('Welcome to my Object Pascal application.? Exit now?',
??? mtConfirmation, [mbYes, mbNo], 0) = mrYes then
? begin
??? MessageDlg('Exiting the Object Pascal application.', mtInformation,
????? [mbOk], 0);
??? Close;
? end;
2.ShowMessage
出現一個含有ok按鈕的消息框
Displays a message box with an OK button.
procedure ShowMessage(const Msg: string);
3.MessageBox
為用戶顯示一個特定的消息
Displays a specified message to the user.
function MessageBox(const Text, Caption: PChar; Flags: Longint = MB_OK): Integer;
with Application do
? begin
??? NormalizeTopMosts;
??? MessageBox('This should be on top.', 'Look', MB_OK);
??? RestoreTopMosts;
? end;
轉載于:https://www.cnblogs.com/sideandside/archive/2007/04/27/729954.html
總結
以上是生活随笔為你收集整理的MessageDlg的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 修改数据库所有者
- 下一篇: 一些ASP.NET不能调试问题的解决办法