Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Which method fires ControlSource?
Message
De
22/06/2016 04:34:26
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01637465
Message ID:
01637547
Vues:
56
>>Hi Dmitry,
>>
>>Keep the "my" code as light as possible. Controls are refreshed more often than you'd expect.
>
>Hi Erik,
>Thank you for the suggestion. The 'my' code is very light (I think). Basically I needed to implement binding a textbox to a PK value and showing in the Value property the Description field of the parent table. So in every Refresh method, my code Seeks a record in the parent table based on the PK value of the bound cursor. I also store the 'last' PK value to the textbox property and only Seek when this PK value changes.
>I did the work and tested it over the weekend. So far it does not seem to have any negative effects. But I will try this approach with some other controls of the app. The more controls I apply it to, the better results I will have in the long run.

Or not... the amount of work that the refreshes have to perform will grow, and while on today's machines you may not see any delay or flicker, you'll have an user out there who will. Depending on your framework, the refreshes may happen more frequently than you expect.

In this case, I have a suggestion: create a form property and bind your control to it. Then in the event of the PK change (which you would control anyway) change this value to whatever you want. This way the code to change the value runs only when it needs to, not on every refresh.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform