Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MessageDlg defualt button

Posted on 2004-08-19
4
Medium Priority
?
1,833 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 200 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

722 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