ContainerControl adding items, items cannot be focussed?

Winston

Junior Contributor
Joined
Jan 25, 2003
Messages
266
Location
Sydney, Australia
I'm writing a custom tab control.

I'm inheriting from ContainerControl, the problem i'm facing is, during design time when u drag a Panel or any other control into the container, you can select the control inside the container, but when i add the control from within the class that dervies from ContainerControl. The controls cannot be selected during design time, is there any reason, how can i fix this?

Thanks.
 
It might help if you post some code showing how your adding the controls from within the class. I can think of no inherent reason it wouldn't work, so it's perhaps the way your adding them.
 
Well from within the container class, it's just simply

this.Control.Add(panel1);

panel1, is already defined, etc, just couldn't be bothered typing the rest of the code.

The panel1 gets added fine, but when u drag the container control onto a form in design time, the panel1, cannot be selected from within the form.

I've sort of figured out and noticed why, but i think the apparent reason is, the form itself has to create the panel and store it inside the form, and then pass just the reference of the panel to the control, well at least that's what i'm noticing from the TabControl.
 
Back
Top