Solved

Default button in a MessageDlg box

Posted on 2001-06-07
4
1,067 Views
Last Modified: 2011-04-14

How can I determine wich button will be the default on in a MessageDlg box ?

MessageDlg('bla bla ?' , mtConfirmation,
      [mbYes, mbNo], 0) = mrYes ;
I want the "No" button to be the default one.
0
Comment
Question by:stendresse
  • 2
4 Comments
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 50 total points
ID: 6165132
I think u can't do that by MessageDlg

 try to use messagebox instead of messagedlg

MessageBox(handle,'Any Message','Any title', MB_YesNoCancel + MB_IconStop + MB_DefButton3)

Best regards
Mohammed Nasman
0
 
LVL 1

Expert Comment

by:edsteele
ID: 6165193
You should be able to do it by placing the mbNo entry before the mbYes entry.  This will have the side effect of make the "No" button on the left and the "Yes" button on the right.  If you can live with that, then here is your new code:

MessageDlg('bla bla ?' , mtConfirmation, [mbNo, mbYes], 0) = mrYes;
0
 

Author Comment

by:stendresse
ID: 6165238
thank you edsteele, but I already tried that but it do not work :(
0
 
LVL 1

Expert Comment

by:edsteele
ID: 6165266
Really?!?  What did it give you?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 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