Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating New Classes
Message
 
À
23/02/2000 13:13:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00336166
Message ID:
00336177
Vues:
20
>I am new to the VFP environment and I am learning by trial and error. I do recall hearing that creating custom base classes was key in decreasing your development time with VFP. Therefore, I am trying to create my own custom classes. However, when I create a class based on an existing class which already has code contained within it, this code is not carried over to the new class. Is there a way to get around this (other than cut and paste)? I know the code will need to be modified, but it would still take less time I believe to make these changes than to start from scratch. Thank you in advance.

Just to add what has already been said. You use the dodefault() method, but you can call it before or after you put your code in the current method. Of course, you don't enter anything if you aren't changing the behavior of the class.

In a textbox - txtmytextbox.click event
this.fontsize = 12
this.fontname = 'Times New Roman'
dodefault() && will call the parent objects default click behavior.
If you have code in the parent class that sets the fontname and size, it will override the above. However, if you placed the dodefault at the beginning of the code, it would be overwritten.
John Harvey
Shelbynet.com

"I'm addicted to placebos. I could quit, but it wouldn't matter." Stephen Wright
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform