J jinghj Unregistered / Unconfirmed GUEST, unregistred user! 2005-12-19 #1 在点击主窗体的关闭按钮时提示是否退出,如果选否那么不退出怎么写啊
J jinghj Unregistered / Unconfirmed GUEST, unregistred user! 2005-12-19 #2 在点击主窗体的关闭按钮时提示是否退出,如果选否那么不退出怎么写啊
D delphi8511 Unregistered / Unconfirmed GUEST, unregistred user! 2005-12-19 #3 procedure TForm1.FormCloseQuery(Sender: TObject var CanClose: Boolean); begin CanClose := MessageDlg('确定要退出吗?', mtConfirmation, [mbOK, mbCancel], 0) = mrOK; end;
procedure TForm1.FormCloseQuery(Sender: TObject var CanClose: Boolean); begin CanClose := MessageDlg('确定要退出吗?', mtConfirmation, [mbOK, mbCancel], 0) = mrOK; end;
D dcx0026 Unregistered / Unconfirmed GUEST, unregistred user! 2005-12-19 #4 窗体有一个事件是OnCloseQuery,看看里面的参数CanClose,赋值为False,窗体就不会关闭了。以后碰到问题,先试着自己去搜索一下,再问别人。
B bluenicer Unregistered / Unconfirmed GUEST, unregistred user! 2005-12-25 #5 代码就是要放在Form的OnCloseQuery里,Canclose:=False;
G geluyx Unregistered / Unconfirmed GUEST, unregistred user! 2005-12-29 #7 OnCloseQuery if not MessageDlg('确定要退出吗?', mtConfirmation, [mbOK, mbCancel], 0) = mrOK then application.run;
OnCloseQuery if not MessageDlg('确定要退出吗?', mtConfirmation, [mbOK, mbCancel], 0) = mrOK then application.run;
C chengangsir Unregistered / Unconfirmed GUEST, unregistred user! 2005-12-29 #9 onclosequery if application.messagebox('确定要退出吗?',mb_yesno+mb_iconquestion)=idyes then application.Terminate
onclosequery if application.messagebox('确定要退出吗?',mb_yesno+mb_iconquestion)=idyes then application.Terminate