Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving changes from a textbox without exiting
Message
De
24/01/2001 12:26:51
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00467981
Message ID:
00467997
Vues:
12
Ko,

Thanx... But, where would I put this code?

Mike
>>I have a form with a toolbar. On the toolbar I have a save button. Normally a user will add or edit the data on the form and click save on the toolbar, and everything works...
>>
>>However, I have on particular user that wants to change the data in one textbox, and then click save. This does not work, the user needs to change the data and then hit TAB or ENTER then click save.
>>
>>Putting the SAVE button on the form allows this behavior, but I want to keep the SAVE button on the toolbar...
>>
>>Is there a way to get this to work with the SAVE button on the toolbar?
>>
>>Thanx,
>>
>>Mike
>

>I have a writebuffer method for that:
>
LOCAL llRetval
>llRetVal = .T.
>
>*-- Code to save field value to buffer when
>*-- clicking on toolbar without leaving the field
>*-- Don't do this for a grid since a grid may change
>*-- work areas unexpectedly
>IF TYPE("thisform.ActiveControl") == "O" AND ;
>    UPPER(thisform.ActiveControl.BaseClass) <> "GRID"
>  IF TYPE("thisform.ActiveControl.ControlSource") <> "U" AND ;
>      !EMPTY(thisform.ActiveControl.ControlSource)
>    IF EVAL(thisform.ActiveControl.ControlSource) <> thisform.ActiveControl.Value
>      REPLACE (thisform.ActiveControl.ControlSource) WITH thisform.ActiveControl.Value
>      *-- We rely on the fact that we revert the field's value
>      *-- in the error event method for the form.
>      llRetVal = (EVAL(thisform.ActiveControl.ControlSource) = thisform.ActiveControl.Value)
>    ENDIF
>  ENDIF
>ENDIF
>
>RETURN llRetVal
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform