Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VMP question
Message
From
10/09/2000 18:16:12
 
 
To
08/09/2000 22:39:00
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00414494
Message ID:
00414732
Views:
21
Mike and Barry,

Thanks. I suspected as much, but wasn't sure.

Alex


>Hello
>
>Its very rare that every control on a form would be involved in a calculation. I'd make a custom object which does the calculation(s) using the values of the required controls. This object may be placed on different forms if the calculation is the same. Use the ActionOnValid method to call the custom object's calculation method. ActionOnValid only fires after your CustomValid (if any) has indicated the control's value is acceptable.
>
>As an example...
>
>txtBox1 has a value of 1
>txtBox2 has a value of 2
>
>ActionOnValid of both txtBox1 and txtBox2 reads...
>This.Parent.cusSum.Sum()
>
>txtBox3 will be updated to show the result.
>
>cusSum has a Sum method which reads...
>WITH This.Parent
> .txtBox3 = .txtBox1 + .txtBox2
> .txtBox3.Refresh()
>ENDWITH
>
>I think this will reduce refresh calls and you won't have duplicate code in each of the various controls.
>
>HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform