Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted
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.
Anybody looking for a graduate programmer (Midlands, England)?
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...