Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Order sequence between form close and control valid
Message
From
05/11/2003 08:38:32
 
 
To
05/11/2003 04:23:08
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00846313
Message ID:
00846399
Views:
18
>
>PROCEDURE object.Valid
>DO CASE
>CASE m.thisform.ReleaseType=0  && Form internal Valid
>
>CASE m.thisform.ReleaseType=1  && Form menu or X close
>
>OTHERWISE                      && Quit FoxPro
>
>ENDPROC
>* Valid no fire if you release the form with
>* form.release or set null to linked var
>
This is really great. I put this in my TextField control base class Valid() event:
* If we are quitting the form or Visual FoxPro
DO CASE

   * Form internal Valid
   CASE ThisForm.ReleaseType=0

   * Form menu or X close
   CASE ThisForm.ReleaseType=1
      IF This.lCloseNoValid
         RETURN .F.
      ENDIF

   * Quit FoxPro
   OTHERWISE
      IF This.lCloseNoValid
         RETURN .F.
      ENDIF

ENDCASE
I also created a property in my TextField control base class named lCloseNoValid.

When being used on the form, if I don't want the valid to fire when I quit the form or quit VFP, I only have to set it to .T. and put this in the Valid of the control:
* No valid when the form is quitting
IF NOT DODEFAULT()
   RETURN
ENDIF

...do the rest of the valid here
Thanks a lot, that is one great tip.
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