Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control.value= how to refresh?
Message
De
27/04/2004 08:58:02
 
 
À
27/04/2004 00:10:01
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00897783
Message ID:
00898471
Vues:
14
Hi Gerry,

Thanks for the clarification. That did the trick!

Tracy

>Yes ... well, for some obscure reason (which I can't fathom), you have to use "brackets" when entering a "formula" via the "property sheet"; eg.
>
>
>(m.prem1+m.prem2)
>
>
>Some distant relation of "named expressions", possibly, or a bad hair day.
>
>>It appears to work programmatically if I set it for instance in the form's init via code, but it does not allow me to enter the formula in the property manually in anyway with/without quotes, the equal sign, etc.
>>
>>
>>>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
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform