Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Repaint a form?
Message
From
25/04/2019 02:11:21
 
 
To
24/04/2019 16:33:13
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01668268
Message ID:
01668277
Views:
72
>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.
Christian Isberner
Software Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform