Sathish
Sathish

Reputation: 1631

inheriting the methods of a control in usercontrol

I developing a usercontrol in csharp in which i will be using a textbox and CheckedListBox control once the usercontrol is done suppose if i want to use some of the methods of Checkedlistbox in my usercontrol what should i do...

Thanks in advance

Upvotes: 1

Views: 61

Answers (1)

Oded
Oded

Reputation: 499132

Just encapsulate them in their own method and delegate calls to them.

If one of the user controls is defined as the field chkListBox, and you want to use the ClearSelected method you can do the following in your class:

public void ClearSelected()
{
   chkListBox.ClearSelected();
}

Upvotes: 1

Related Questions