Discussion:
Default button in form
(too old to reply)
Andre
2007-10-11 13:09:33 UTC
Permalink
Hi all,

I have a form with a "default" button. So, anywhere the user hit "enter"
key, the OnClick event for this button is triggered.

In my funcion there is a teste that might find a condition that the form
should not close anymore. That is, an error condition that should keep
the form opened so the user can fix the found problems.

How do I keep the form open, without taking off the "default" property
for the button (so the "enter" key still trigger OnClick)?

Thanks.

Andre
Bruce Salzman
2007-10-11 13:59:31 UTC
Permalink
Post by Andre
Hi all,
I have a form with a "default" button. So, anywhere the user hit "enter"
key, the OnClick event for this button is triggered.
In my funcion there is a teste that might find a condition that the form
should not close anymore. That is, an error condition that should keep the
form opened so the user can fix the found problems.
How do I keep the form open, without taking off the "default" property for
the button (so the "enter" key still trigger OnClick)?
In a form displayed with ShowModal(), you can set ModalResult to mrNone if the
test fails.
--
Bruce
Remy Lebeau (TeamB)
2007-10-11 17:33:14 UTC
Permalink
Post by Andre
How do I keep the form open, without taking off the "default"
property for the button (so the "enter" key still trigger OnClick)?
Use the form's OnCloseQuery event.


Gambit
Andre
2007-10-18 14:53:44 UTC
Permalink
Great! Thank you both. :)
Post by Remy Lebeau (TeamB)
Post by Andre
How do I keep the form open, without taking off the "default"
property for the button (so the "enter" key still trigger OnClick)?
Use the form's OnCloseQuery event.
Gambit
Continue reading on narkive:
Loading...