惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
Y
Y Combinator Blog
Jina AI
Jina AI
G
Google Developers Blog
Last Week in AI
Last Week in AI
博客园 - 叶小钗
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
IT之家
IT之家
The GitHub Blog
The GitHub Blog
D
Docker
量子位
罗磊的独立博客
腾讯CDC

博客园 - 左左右右

连接 password ttreeview 一些汇编指令 Delphi与汇编 TObject.Dispatch TApplication与主消息循环 核心库类之TGraphicControl/TcustomControl 与画布(Canvas) 核心库类之TControl 核心库类之TObject 内存管理 触发器 模式窗体和非模式窗体 在dll中delphi中封装窗体(实例) dll 杂题 Delphi异常 Delphi与C++的语法区别 消息自定义
MessageDlg
左左右右 · 2007-04-27 · via 博客园 - 左左右右

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;