On Thu, 26 Jan 2012, Koenraad Lelong wrote:

Hi,

I'm using a MessageDlg to show some information, with multiple buttons. Unfortunately, in this case, I would like to have another button as default. Is there a way to do this ?

What I have :
if MessageDlg('Attention', 'Data does exist, overwrite ?', mtWarning,[mbNo, mbYes],0) = mrYes then ...

I would like the mbNo to be the default button.

Thanks for any pointers,

Do not use Yes/No buttons. Use QuestionDlg and do something like

If QuestionDlg('Attention','Data already exists. What to do',
               mtWarning,[mrYes,'Overwrite',mrNo,'Keep existing data'])=mrYes 
then

This is a better dialog, and allows you to put the 'default' answer as
mrYes.

Michael.

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to