Board index » cppbuilder » Default button in form

Default button in form


2007-10-11 09:09:33 PM
cppbuilder48
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
 
 

Re:Default button in form

"Andre" < XXXX@XXXXX.COM >wrote in message
Quote
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
 

Re:Default button in form

"Andre" < XXXX@XXXXX.COM >wrote in message
Quote
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
 

{smallsort}

Re:Default button in form

Great! Thank you both. :)
Quote

>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