分享

delphi 关闭窗口提示 | 吴俊杰的技术日志

 容心居 2020-01-17

在窗口的OnCloseQuery里写下面的代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
case Application.MessageBox('确定退出系统?','询问',35) of
6:
begin
ShowMessage('按了是,窗口关闭');
CanClose:=True;
end;
7:
begin
ShowMessage('按了否,返回登陆窗口');
CanClose:=True;
//这里写上你的登陆窗口调用代码
ShowMessage('登陆窗口出现了');
end;
2:
begin
ShowMessage('按了取消,窗口不关闭');
CanClose:=False;
end;
end;
end;

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多