Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Override Methods in a Class
Message
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00498491
Message ID:
00498508
Vues:
12
>hi Guys
>I am building an Activex control in vb for my Base Text Box, To be used in my VB applications. But in my sub class I want to overide my parent class method. How can I do it in VB 6.
>
>For Eg. My base text box(activex) has a Gotfocus Event Which makes the background color red and the lostfocust event which makes the background color white. Now in some places in my application I want to make it green in the Gotfocus event. I put the code to make the backcolor green but then the parent class overrides it with red. Is there anyway to avoid the parent class method from making the backcolor red ?.

There is no clean way of doing it. But you have at least 2 choices:
-Trigger the event in the form.
-Add boolean properties to indicates if code has to be run or not.

VB.Net will implement better of doing it.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform