ShowModal2 (C++)
Description
The following methods are used for buttons in a form that is used as a modal dialog box. The methods cause the dialog box to terminate when you click either the OK or Cancel button, returning mrOk or mrCancel from ShowModal, respectively. You could also set the ModalResult value to mrOk for the OK button and mrCancel for the Cancel button to accomplish the same thing. When you click either button, the dialog box closes.
Code
void __fastcall TMyDialogBox1::OKButtonClick(TObject *Sender)
{
ModalResult = mrOk;
}
void __fastcall TMyDialogBox1::CancelButtonClick(TObject *Sender)
{
ModalResult = mrCancel;
}
Uses
- Vcl.Forms.TCustomForm.ModalResult ( fr | de | ja )
- Vcl.Forms.TCustomForm.ShowModal ( fr | de | ja )