form1.ShowModal = mrOK 中mrOK代表什么,应如何得到

解决方案 »

  1.   

    你的窗口返回的参数,如果窗口中有一bitbtn, 可设置为bkOK,窗口的返回值为mrOK
      

  2.   

    读一下Delphi的帮助就知道了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.procedure TMyDialogBox.OKButtonClick(Sender: TObject);begin
      ModalResult := mrOK;
    end;procedure TMyDialogBox.CancelButtonClick(Sender: TObject);
    begin
      ModalResult := mrCancel;end;
      

  3.   

    在form中有OKbtn,当单击按钮时如何使窗体返回mrok
      

  4.   

    onclick事件中加入:
    form.ModalResult := mrOk;
    它一般用于登录窗口,成功登录后传递给主窗口mrOK。
      

  5.   

    一个常量查看Controls单元const
      mrNone     = 0;
      mrOk       = idOk;
      ...
      

  6.   

    就是无论是点击OK按钮,或是关闭窗体都会发送mrOK给主窗体
      

  7.   

    你是不是在Form的CloseQuery中有代码form.ModalResult := mrOk;?不可能呀
      

  8.   

    按钮有一个kind属性,当它设成mrOK时,点击它之后将关闭Form,返回值将是mrOK
      

  9.   

    在form中有OKbtn,当单击按钮时如何使窗体返回mrok