Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • Administrators
Posted

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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...