Mike Yearwood
Toronto, Ontario, Canada
Information générale
Catégorie:
Gestionnaire d'écran & Écrans
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
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement