在用Button做关闭程序是可选择是否真的关闭
可是在窗体上的关闭按钮(小叉叉)该怎么处理??
本人虚心向知道的人请教.
谢谢!!
在Form1->OnCloseQuery()里加入判断
在 Form的 OnCloseQuery 里面写
if xxxx then
CanClose:= true
else
CanClose:= false;
或者
CanClose:= xxxx=yyy;
void __fastcall TForm1::FormCloseQuery(TObject *Sender, bool &CanClose)
{
if (MessageDlg("允许关闭吗?", mtConfirmation, TMsgDlgButtons() << mbOK << mbCancel,0) == mrCancel)
CanClose = false;
}
还是你们手快,支持
支持
只要Message,什么都OK
void __fastcall TForm1::FormCloseQuery(TObject *Sender, bool &CanClose)
{
if(MessageBox(Handle,"are you sure quit?","warning",MB_OKCANCEL|MB_ICONQUESTION)==1)
CanClose=true;
else
CanClose=false;
}