1

Have a set of user controls in a Winforms application (C#):

  • A - inherits from UserControl, contains the protected treeview tnA in a tablelayoutpanel + some buttons and an imagelist.
  • B - inherits from A
  • C - inherits from A

Now I have two problems:

1) I cannot add new controls to B and C.

When I try to drag a checkbox onto B [Design], I get a black circle with line across.

The tablelayoutpanel on A is modifiers = protected.

2) I cannot add events to the treeview on B.

I would for example like to implement tnA.NodeMouseClick() on B, but the event isn't raised.

Any ideas for how these two things can be fixed?

Thanks!

Louisa
  • 552
  • 1
  • 9
  • 22
  • 1
    UserControl has its own designer after you drop it on a form. A very simple one, it just puts drag handles around its border and exposes any public properties you added in the Properties window and that's all. You'd have to write your own designer class to get more. You can enable the designer for a control inside the user control, [like this](http://stackoverflow.com/a/2863807/17034), but that doesn't work for the kind of controls that were added in .NET 2.0 and have a fancy designer themselves. Like TableLayoutPanel. You'll have to re-think this, writing code always works. – Hans Passant Aug 26 '16 at 13:02

0 Answers0