Solved

Default button in a MessageDlg box

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

911 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

23 Experts available now in Live!

Get 1:1 Help Now