[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1078
  • Last Modified:

Default button in a MessageDlg box


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
stendresse
Asked:
stendresse
  • 2
1 Solution
 
Mohammed NasmanSoftware DeveloperCommented:
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
 
edsteeleCommented:
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
 
stendresseAuthor Commented:
thank you edsteele, but I already tried that but it do not work :(
0
 
edsteeleCommented:
Really?!?  What did it give you?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now