Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control.value= how to refresh?
Message
De
26/04/2004 15:03:40
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
 
À
26/04/2004 09:11:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00897783
Message ID:
00898285
Vues:
17
The ControlSource is entered as a "string". Did you try:

..ControlSource = "m.prem1+m.prem2"

(This becomes a Read-Only control, however).

eg.
m.a = "Waa"
m.b = "Zoo"

o1 = createobject("form1")
o1.show
on key label esc clear events
read events
on key label esc

define class form1 AS form
   add object txt1 as textbox with ;
      controlsource = "m.a + m.b"

   add object cmd1 as commandbutton with ;
      left = 100, caption = "Clear"
   add object cmd2 as commandbutton with ;
      left = 100, top = 30, caption = "Refresh"

proc cmd1.click
   for each m.o_ctl in thisform.controls
      if upper(m.o_ctl.class) = "TEXTBOX"
         m.o_ctl.value = space(len(transform(m.o_ctl.value,"")))
      endif
   next

proc cmd2.click
   thisform.refresh()
   thisform.draw()
enddefine
>I have never been able to do that. It always returns "the data source for this object must be a variable reference.'
>
>>Hi
>>Put the formula in ControlSource , will work, and the value will be updated also
>>
>>
>>>If a control has nothing in the controlsource but has a formula for its value i.e. m.prem1+m.prem2 refreshing the control does not run the formula again. Is there anyway to refresh those controls without restating the value as in this.txtprem_tot.value=m.prem1+m.prem2?
>>>
>>>TIA,
>>>Tracy
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform