/*
ModalResult, ShowModal example
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 the user clicks 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 the user clicks either button, the dialog box closes.
*/ 
void __fastcall TOKRightDlg::OKBtnClick(TObject *Sender)
{
  ModalResult = mrOk;
}
void __fastcall TOKRightDlg::CancelBtnClick(TObject *Sender)
{
  ModalResult = mrCancel;
}
/*
This code brings up the modal dialog from Form1 when a button is clicked.  It causes a Beep if the OK button is clicked.
*/ 
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  if (OKRightDlg->ShowModal() == mrOk)
    MessageBeep(0);
} 
