Thanks Steve,

Very good to know about this MesssageDlg.

In addition, wouldn't it be even better to put the MessageDlg in a loop till
Yes or No is clicked!? Otherwise the cancel (x) seems for the user an escape
but for the program an ongoing process that the user definitely not wanted
after all.

Cheers,

John.




> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Steve Peacocke
> Sent: Wednesday, 20 June, 2001 17:36
> To: Multiple recipients of list delphi
> Subject: [DUG]: Traps with MessDlg()
>
>
> We came across an interesting little ditty the other day that you all may
> want to take note of.
>
> We had a MessageDlg like the following that gave the user the
> choice of Yes
> or No buttons...
>
> If MessDlg('Warning: Silly thing done, Process Anyway?' ...) = mrNo then
>       Exit // and lose the changes
> else
>       PostAllChangesAndUpdateEverything;
>
> Now the problem occured when a user, not sufficiently confident in what
> he/she was doing, and not built for making management decisions
> like Yes or
> No, closed the message Dialog box by clicking on the little [x]
> on the form
> figuring that was a neat way not to have to make the decision to the
> horrible question and make everything just go away.
>
> A bit of testing showed that closing the form by using Alt-F4 or clicking
> on the [x] will return an mrCancel even though there is no cancel button.
>
> We took this insight calmly and in our stride and made the decision to
> panic. We checked all our code (megs and megs of the bloody
> stuff) to check
> each call to MessageDlg to change the above to...
>
> If MessDlg(....) <> mrYes then
>
>
> Steve Peacocke
> (025) 951-251
>
> Dilbert: "Do not meddle in the affairs of dragons for thou art
> crunchy and
> wouldst taste good with sauce"
>
> ------------------------------------------------------------------
> ---------
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to