I think it is a fairly common practise in Windows applications to enable 
users to use the keyboard to OK or Cancel a modal dialog no matter which 
component has the focus.  This is particularly useful for blind users. 
As mentioned, you have most likely set the Default property on the OK 
button to True, which I always do on model forms.  It is also common to 
set the Cancel property on the Cancel button to True, so the user can 
press Escape to exit the form without saving changes.

Regards,
Ross.

----- Original Message ----- 
From: "Rainer von Saleski" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, December 15, 2005 6:02 AM
Subject: Unexpected Exit from ShowModal Form


I use ShowModal forms all over the place ... and they all have a button 
that
does some cleanup and sets ModalResult to mrOK in order to exit ... and 
the
button only activates when the user clicks it, or the button has the 
focus
and the user presses Return (I think).

But I have one form, not horribly complex, where pressing Return causes 
the
form to exit, no matter where the focus is (seemingly).  It has 2 
TListViews
(View Style = vsReport), 3 panels, a dozen buttons, half a dozen check
boxes, one combo edit box, half a dozen labels, three timers, and a Rave
RvSystem.

Any ideas?  It's driving us nuts, because we "feel" like hitting Return 
all
too often.

Rainer

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to