Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Order sequence between form close and control valid
Message
From
04/11/2003 23:52:06
 
 
To
04/11/2003 23:41:38
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00846313
Message ID:
00846327
Views:
27
>I had a similar problem recently and I found that if you are closing the form using the "X", there is no way to prevent the valid code from running in the last object that had the focus. However, if you are releasing the form by clicking on a command button that is located on the form you can prevent the valid code from running by creating a form property, such as lIsExiting, and setting it to .T. in the gotfocus event of the command button. Then place validation code in the valid event of the object that prevents the code from running if thisform.lIsExiting = .T.
>
>Unfortunately, I couldn't find a way to access the gotfocus event of the "X" button so I had to set the form's closable property to .F. and remove the user's ability to close the form with the "X". It's not the best solution, but it worked.

Instead of Valid() event, I could put the code in a method and call that method when the keypress of the control textbox is a carriage return.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform