Delphi中我在Form里新建了一个Button用来关闭exe应用程序。
然后我要求点击按钮有提示问是否要删除,另外点击Form上的关闭按钮也要有一样的提示
如何做?
Delphi中我在Form里新建了一个Button用来关闭exe应用程序。
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
1条回答 默认 最新
threenewbee 2016-03-17 15:20关注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;在你的按钮上也写form.Close();
解决 无用评论 打赏 举报