inheritance question

zildjohn01

Newcomer
Joined
Apr 22, 2005
Messages
2
hi all, i have a question about inheritance of windows forms controls.

is there any way to inherit from 'Control' and add functionality that all controls will have? For example if I inherit from 'Control' and add MyMember, is there any way to have a text box include MyMember also? So far I have been inheriting from every Windows Forms control and adding the same functionality, it seems there may be an easier way...

Many thanks in advance for an answer.
 
There is no way to extend the existing base classes in that way - you couldn't simply get the existing controls to inherit from your base class.
However you may want to look at the IExtenderProvider interface - this will allow you to add additional functionality to controls at design time e.g. the tooltip component.
 
Back
Top