Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Method override question
Message
De
02/02/2006 13:43:38
 
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
01093000
Message ID:
01093008
Vues:
24
Short answer is No. A method can be overridden in a sub-class, but not in an instance of the class.

What you probably want to do is create an Event in that class with an overrideable eventhandler and then the Form can subscribe to the Event however it needs to.

~~Bonnie




>Hi all,
>suppose you have created an inherited class, let me say from the groupbox baseclass, and added an overridable function like:
>
>
>Public Overridable Function ppp() As Boolean
>    MessageBox.Show("ppp in baseclass")
>    return true
>End Function
>
>
>Then you drop the inherited class onto a form, is it possible to overrides the ppp function a the form "level"?
>What I want is to write the "default" code in the class, than in every form where I need specific code for the ppp method I need to overwrite the overridable function.
>I'm not able to override code for objects contained in the form...
>
>franco
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform