Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Control.value= how to refresh?
Message
From
26/04/2004 15:28:14
 
 
To
26/04/2004 15:03:40
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00897783
Message ID:
00898292
Views:
17
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"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform