Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Repaint a form?
Message
De
29/04/2019 19:45:50
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01668268
Message ID:
01668311
Vues:
55
Thank you Christian.

>>Can I re-display the content of a form?
>
>There are two separate methods for two different purposes:
>
>THISFORM.Draw() && Repaints the form controls. For instance you are in a loop and you update a label caption.
>Without the Draw() in the example you won't see any of the changes in the label caption until the method finishes. Similar when you create, re-position or change any other layout properties of visible controls.
>
>FOR lnNr = 1 TO 100
>    THISFORM.lbl.Caption = "Text " + TRANSFORM(m.lnNr)
>    … do some processing...
>    THISFORM.Draw()
>ENDFOR
>
>
>THISFORM.Refresh() && To update display value in controls that are bound to fields or variables using controlsource.
>Without the Refresh() in the example you won't see the replaced value in Customer.Firstname.
>
>THISFORM.txt.ControlSource = "Customer.Firstname"
>REPLACE Firstname WITH "Test" IN Customer
>THISFORM.Refresh()
>&& or selectivly:
>THISFORM.txt.Refresh()
>
>
>Very often Refresh() is being used where Draw() was actually meant. But Refresh() has no other effect except updating changed values in controlsources. So in the first example, THISFORM.Refresh() would not be correct.
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform