Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BINDEVENTS and stopping the event
Message
 
 
To
02/12/2003 19:25:09
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00855252
Message ID:
00855263
Views:
13
Trey,
Thanks for the answer. I was using this case as an example. The IsOkay() method is being bound to many different controls on the form. Any thoughts? I don't really want to write and maintain a check like the one you described in several places. Thanks again,

jfh

>>Hello,
>>Lets say I have a piece of code that returns .T. or .F. depending on if it is okay to close a form or not. Now, the exit button on the form just calls the forms release method. So, I bind the click of the button to the IsOkToExit method on the form. The method, in this case, returns .F., how to I halt the execution of the button's code? Thanks,
>>
>>jfh
>
>I wouldn't bind the event in this case.
>
>You could wrap the call, e.g.
>
>
** exit button's Click() event
>If thisform.IsOkToExit()
>  thisform.Release()
>EndIf
>
>My preferred way of doing this is to put the IsOkToExit call in the form's QueryUnload(), then, even if the user clicks the 'x' to close the form it still halts the release, e.g.
>
>just call the release in the button click
>
** exit button's Click() event
>thisform.Release()
>and let the QueryUnload() handle the exit approval
>
** QueryUnload()
>Return thisform.IsOkToExit()
>
>
>If the QueryUnload() returns .F., the form release is halted.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform