Solved

Default button in a MessageDlg box

Posted on 2001-06-07
4
1,063 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:
mnasman 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now