Delphi CreateMessageDialog


本文整理自网络,侵删。

 CreateMessageDialog


unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

var
MsgInfo, MsgErr: TForm;

procedure TForm1.FormCreate(Sender: TObject);
begin
MsgErr := CreateMessageDialog('错误', mtError, [mbOK]);
MsgInfo := CreateMessageDialog('提示', mtInformation, [mbYes, mbNo], mbYes);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
MsgErr.ShowModal;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
MsgInfo.ShowModal;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
case MsgInfo.ShowModal of
IDYES: Text := 'Yes';
IDNO : Text := 'No';
else
Text := 'Form1';
end;
end;

end.

相关阅读 >>

Delphi 读取图像文件base64编码加载到image组件显示图片

Delphi 关于 class helper for ... 语法

Delphi 按钮躲避鼠标点击

Delphi 字母大小写转换

Delphi cxgrid使用小结

Delphi 实现类似windows的查找功能-遍历整个硬盘目录

Delphi #9、 #10、 #13 表示的意思

Delphi 新建一个txt文档函数

Delphi 对汉字字符串的截取问题

Delphi tstringlist utf8编码保存并开启bom

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...