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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inheriting Button Class

Status
Not open for further replies.

Warlocks

Technical User
Jan 9, 2003
79
GB
Hi,

I have created a UserControl which effectively wants to behave like a button but look different (made up of 3 graphics). The reason for this is that I wish to use the same style of button in various places but obviously with different text so have used a process of using a table/row/cells to create the effect and put the label (as a method) in the centre cell.

However, I know you are able to have "things" inherit from other "things" so was wondering whether I could inherit my usercontrol from a button to keep the existing functionality i.e. the Button1_Click event etc. This would save me having to put hyperlinks around my UserControl in order to make an event but also will ensure I can do other things than just call other forms...

Any help is much appreciated.

Cheers,

Woody.
 
You can have your UserControl inherit the properties and methods of the System.Windows.Forms.TextBox. Have a read of the following article for a simple use of inheritance with a UserControl:


----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top