Windows Develop Bookmark and Share   
 index > Windows Forms General > Custom Control to act as container
 

Custom Control to act as container

Hello All,

I've written a custom control which is basically a panel (with added features). I would like it to behave as a true panel - i.e. be able to contain other controls. Currently, any controls I place "in" the panel actually attach to my test form - they will not move with the custom panel. Is there a way of making a custom control behave as a "true" container?

Many thanks.

SolidSpace  Thursday, November 23, 2006 12:18 PM
Does your custom control derive from Panel? If you derive from Panel, you should have all the functionality of a "true panel", be able to contain other controls, and do whatever else a panel can.
John_Lee - MSFT  Tuesday, November 28, 2006 12:15 AM
what is your custom control derived from? In your case it may be best to derive it from UserControl which I think should work for your purposes. If not, any Control that is derived from ContainerControl should do it.
JeroGrav  Tuesday, November 28, 2006 3:21 AM

Pls look at -

http://support.microsoft.com/kb/813450

Hope this helps.

Karthik Krishnaswami  Tuesday, November 28, 2006 3:21 AM

You can use google to search for other answers

Custom Search

More Threads

• get value of checked item in checkedlistbox
• How to trap for esc key in a loop?
• Open form asynchronosly with reportviewer?
• How to print image with print document control
• Tristate checked treeview
• TreeView, select node by pressing Enter
• Issue Updating Graphics
• Can i access text box in threading ?
• Where is the "Console" in Form based applications?
• Charting Tool