FormCloseQuery

 
void __fastcall TForm1::FormCloseQuery(TObject *Sender, bool &CanClose){
if (MessageDlg("Close the form?", mtConfirmation, TMsgDlgButtons() << mbOK << mbCancel,0) == mrCancel)
    CanClose = false;
}




原文地址:https://www.cnblogs.com/xe2011/p/83ef754b99175070ccaa8de2ca068887.html