Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Override question

Status
Not open for further replies.

Sorwen

Technical User
Nov 30, 2002
1,641
0
0
US
I have an object that is NotInheritable. The event I need to access for this object is protected. The question I come to as I think of it is there a way to addhandler to a protected event? Or how can you override a protected event when you cannot Inherit from an object?

-I hate Microsoft!
-Forever and always forward.
 
YOu have to use composition than and withevents. If you only need to override one event that could work.

Christiaan Baes
Belgium

My Blog
 
Thanks. I'll have to look into composition.

-I hate Microsoft!
-Forever and always forward.
 
<how can you override a protected event when you cannot Inherit from an object

Well, you can't, given that "overriding" means changing the implementation of a method of a base class. By definition, that means that you have to inherit from the base class in order to override anything from it.

I'm getting the feeling that you're trying to override the event handler's signature for some reason. Can you explain further what you're trying to do and why?

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top