Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use dataenvironment subclass
Message
De
28/07/2006 10:18:08
 
 
À
27/07/2006 23:43:31
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01140554
Message ID:
01141088
Vues:
16
>>>>I've just started to explore the dataenvironment and cursoradapter as subclasses. I am wondering if there is a way that is generally accepted as better than others for using these classes. It appears that I can either drop a DE class on a form, instantiate it in code in the form init, or use the DEclass property. Of those three methods which way is considered best? (or if there is something I don't know about please enlighten me!)
>>>
>>>Um... not the form's init, but form's load. You want the tables open before the controls instantiate, and form's init happens later.
>>
>>Of course... I'd have caught that.
>>
>>> You can use the new .bindcontrols property and bind them after DE object is created.
>>
>>My real question is though... which method is generally accepted as the best way to instantiate a DE class? Drop the DE on the form? Call it up from code? Use the DEClass property?

>No preference there from me - my forms don't have a DE.
>I figure that'd be a matter of your style, whatever you feel is the easiest to maintain. And I doubt there's any significant speed difference between the three.


I would expect that it is a matter of preference and possibly convenience. If you build a visual class and drop it on the form, then you cannot open the DE for editing while the form is open (you have to close the form and then open the DE class, close and go back to the form -- this is true for any class dropped on the form). However, with the visual class on the form, you have intellisense to reference the members during code writing. Also, if you want to override any inherited code behavior of the DE class in the main form, then the DE needs to be on the form to reference it.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform