MessageDlg( 'string', mtError, mbCancel, 0);[Error] Unit1.pas(250): Incompatible types: 'TMsgDlgButtons' and 'TMsgDlgBtn'
[Fatal Error] Project1.dpr(8): Could not compile used unit 'Unit1.pas'

解决方案 »

  1.   

    MessageDlg( 'string', mtError, [mbCancel], 0);
      

  2.   

    function MessageDlg(const Msg: string; DlgType: TMsgDlgType;
      Buttons: TMsgDlgButtons; HelpCtx: Longint): Integer;
      

  3.   

    函数使用为:
    MessageDlg( 'string', mtError, [mbCancel], 0);函数原型为:
    function MessageDlg(const Msg: string; DlgType: TMsgDlgType;  Buttons: TMsgDlgButtons; HelpCtx: Longint): Integer;
      

  4.   

    procedure TForm1.Button1Click(Sender: TObject);begin
      if MessageDlg('Welcome to my Delphi application.  Exit now?',
        mtConfirmation, [mbYes, mbNo], 0, mbYes) = mrYes then
      begin
        MessageDlg('Exiting the Delphi application.', mtInformation,
          [mbOk], 0, mbOk);
        Close;
      end;end;
      

  5.   

    MessageDlg( 'string', mtwarning, [mbok], 0);
    我寫程序常用這個.
      

  6.   

    为什么不直接用MessageBox啊,好用的