Custom container control with limited container region

Custom container control with limited container region

Post by mnuckol » Wed, 29 Aug 2007 00:45:07


I am trying to create a custom container control for Windows Forms
using C#.NET 2.0. My problem is that I want only part of the control
to allow other controls to be placed on it at design time. A similar
example to what I'm trying to accomplish is a Tab Control. The tab
pages of a tab control allow child controls to be added to the page
region, but not to the tab. Does anyone know how to accomplish this?
 
 
 

Custom container control with limited container region

Post by Nicholas P » Wed, 29 Aug 2007 01:01:50


This is done through separate controls on the TabControl. The
TabControl has TabPage instances which it exposes which you can drop
controls on. You have to take the same approach, having a child control
which will be allowed to host controls, and then not allow it on the parent.


--
- Nicholas Paldino [.NET/C# MVP]
- XXXX@XXXXX.COM