Solved

MessageDlg defualt button

Posted on 2004-08-19
4
1,828 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:Ehsun
4 Comments
 
LVL 3

Expert Comment

by:Tyrsis
ID: 11849833
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
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 11850363
you could use the windows.messagebox-API like

  if windows.messagebox(self.handle,  //handle
                       'MyMessageText',  //text
                       'MyMessageCaption' //Caption
                       ,MB_ICONINFORMATION or  //Icon to Show
                        mb_YesNoCancel or  //ButtonSet
                        MB_DEFBUTTON2) //Default Button (No in this Case)
                        = mrYes then;

meikl ;-)
0
 
LVL 3

Expert Comment

by:lmikle
ID: 11852280
Add a QDialogs to uses cause to get access to MessageDlg qith 6 parameters.
0
 
LVL 2

Expert Comment

by:Delani
ID: 11855270
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).

0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi procedure  - Unsatisfied forward or external declaration. 2 183
find a node in VST 2 70
Create a path if not exists 7 86
Delphi: barcode reading on android platform 1 51
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question