Link to home
Start Free TrialLog in
Avatar of Ehsun
Ehsun

asked on

MessageDlg defualt button

How can I use from other syntaxes of MessageDlg function.
It's first syntax has 4 parameters that works proparely, but other syntaxes (overload) that have more than 4 parapeters don't work!!!
For example in the 6-parapeter that 5th parameter is for defining default button and 6th parameter is for Tbitmap don't work.!!!

this is the example of delphi help, but it doesn't work too!!!

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;
-----------------

Please guide me! Thanks
Avatar of Tyrsis
Tyrsis

The MessageDlg's listed in the help file are actually for the CLX.  You'll have to use CLX if you want to use those versions of MessageDlg().  Or you can try copying the code out of QDialogs if you want to use it with VCL.  The VCL version of MessageDlg only has one version. (The first one listed I believe)

Tyrsis
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Add a QDialogs to uses cause to get access to MessageDlg qith 6 parameters.
What you really need is the standard VCL function Application.MessageBox, which wraps around the windows API. (You can look it up in the Delphi helpfile).