Adding controls to an inherited UserControl

E

elziko

I have sucessfully created a control that inherits from a UserControl.

Now I want to extend this by adding extra controls but if I try and drop a
control onto the form then I just get the "No" cursor and I'm not able to
drop the control onto the designer.

I can add controls in the InitializeComponent procedure of my inherited
UserControl and they do appear in the designer at design time but am unable
to edit any of it properties.

Is this by design? Can I only extend the non-visible part of this class? If
so, whats the logic behind it?

TIA
 
E

elziko

I think I have figured out what I was doing. My original UserControl actualy
had a GroupBox taking up its entire designable surface. So when I was trying
to drop a control onto the inherited UserControl it was actually being
droppped onto the GroupBox of the base class which was declared as private.
By changing this to public it soved my problem.... however, is this a
sensible way to deal with the problem?

TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top