modalresult的返回值是多少????
mrno
mrok
mryes
mrerror
mrnone
mrcancel
mrretry
mrabort
mrignore
mryestoall
mrall

解决方案 »

  1.   

    这些值在VCL中是有定义的:controls.pas
    const
      mrNone     = 0;
      mrOk       = idOk;
      mrCancel   = idCancel;
      mrAbort    = idAbort;
      mrRetry    = idRetry;
      mrIgnore   = idIgnore;
      mrYes      = idYes;
      mrNo       = idNo;
      mrAll      = mrNo + 1;
      mrNoToAll  = mrAll + 1;
      mrYesToAll = mrNoToAll + 1;windows.pas中定义的值:onst
      { Dialog Box Command IDs }
      {$EXTERNALSYM IDOK}
      IDOK = 1;          ID_OK = IDOK;
      {$EXTERNALSYM IDCANCEL}
      IDCANCEL = 2;      ID_CANCEL = IDCANCEL;
      {$EXTERNALSYM IDABORT}
      IDABORT = 3;       ID_ABORT = IDABORT;
      {$EXTERNALSYM IDRETRY}
      IDRETRY = 4;       ID_RETRY = IDRETRY;
      {$EXTERNALSYM IDIGNORE}
      IDIGNORE = 5;      ID_IGNORE = IDIGNORE;
      {$EXTERNALSYM IDYES}
      IDYES = 6;         ID_YES = IDYES;
      {$EXTERNALSYM IDNO}
      IDNO = 7;          ID_NO = IDNO;
      {$EXTERNALSYM IDCLOSE}
      IDCLOSE = 8;       ID_CLOSE = IDCLOSE;
      {$EXTERNALSYM IDHELP}
      IDHELP = 9;        ID_HELP = IDHELP;
      {$EXTERNALSYM IDTRYAGAIN}
      IDTRYAGAIN = 10;
      {$EXTERNALSYM IDCONTINUE}
      IDCONTINUE = 11;
      

  2.   

    mrNone  0    None. Used as a default value before the user exits.
    mrOk  1 The user exited with OK button.
    mrCancel  2 The user exited with the CANCEL button. 
    mrYes  3 The user exited with the YES button.
    mrNo  4 The user exited with the NO button.
    mrAbort  5 The user exited with the ABORT button.
    mrRetry  6 The user exited with the RETRY button.
    mrIgnore  7 The user exited with the IGNORE button.
    mrAll  8 The user exited with the ALL button.
    mrNoToAll  9 The user exited with the NO TO ALL button.
    mrYesToAll 10     The user exited with the YES TO ALL button.
      

  3.   

    你可以在Button的Click事件中给它赋值呀,你给什么,它就返回什么:
      ModalResult := mrOK ;