Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Method override question
Message
From
02/02/2006 13:43:38
 
General information
Forum:
ASP.NET
Category:
Class design
Miscellaneous
Thread ID:
01093000
Message ID:
01093008
Views:
23
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
Previous
Reply
Map
View

Click here to load this message in the networking platform