Inheriting from UserControls

C

Charles Law

I want a set of controls that all have a border, like a group box. I thought
I would create a base control containing just a group box from which my set
of controls could inherit. Assuming that this is the right approach (please
tell me if it is not), how then do I make it so that the group box cannot be
moved around on my set of controls, but is also able to act as container for
other controls?

If I leave the modifier of the group box as Friend, or Private, then the
group box appears locked on the inheriting controls, but I cannot drop new
controls onto it. If I change the modifier to Protected, Protected Friend,
or Public, then I can drop controls onto the group box, but I can also move
the group box around on the inheriting control.

Is there something else I must do?

TIA

Charles
 
C

Craig Vick [MSFT]

Hi Charles,

It maybe easier to simply inherit from GroupBox. The problem is you won't
have a designer when you write the control so you'll have to do everything
in code.

Craig VB. NET Team
 
C

Charles Law

Hi Craig

I see what you mean. I have just tried it, but I think the absence of a
designer will be a problem. I want to be able to lay out my inheriting
control visually, rather than 'guess' the position of things in code.

It's a shame that inheriting from GroupBox doesn't give a designer inside a
group box.

Charles
 

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