Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is the easiest way to duplicate a class in a VCX
Message
 
À
11/12/2008 16:50:42
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01366733
Message ID:
01366790
Vues:
11
>>>I have a class library with a combobox that I've customized by adding additional properties and methods. Now I want to use it as a starting point for another combobox class. Can I duplicate it without having to manually rebuild the entire thing as a new class? I thought that the Class Browser might do it but I don't see anything there.
>>Mike,
>>
>>The whole idea of classes it that you can use the existing cxlass as a starting point for a new subclass by simply creating a new class that is a subclass of your existing class. You don't copy and paste code to the new class, you make the new class a subclass of the existing one and it magically gets all of the code and properties of the existing class.
>
>I understand what you are saying and perhaps I have a bad class design, but, I really do want to copy the class as a starting point. I'm going to remove a lot of the existing properties and methods and add to it. Rather than trying to retype all that stuff, I figured it would be easier to copy it, delete the unnecessary parts, then go from there.

In that case then best, and easiest way to do this, is to open the class library with your existing class in it and then open another VCX and drag and drop the class from one to the other.

I can't recommend strongly enough that your best alternative is to fix what you have and make it right for subclassing rather than using an OOP powrerhouse to do copy and paste programming.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform