可爱的 CreateMessageDialog
16lz
2021-05-01
可爱的 CreateMessageDialog
unit Unit1;interfaceuses 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.
更多相关文章
- 使用 IXMLHTTPRequest 简单获取网页源代码
- ExtCtrls.Frame3D
- 关于分库分表后的数据统计异构方案
- nginx开启日志,指定格式,查看执行时间
- windows server 2016安装网卡驱动【引用】
- 解密代码
- 发文章加密教程
- pycharm用爱发电
- arc_loss训练手写数字分类