User Control with container area? [modified]
-
Hi, I'm developing a WinForms (VB.NET 2.0) application where I have a user control which contains several fixed controls (toolstrip, buttons, panels, etc.). This works just fine - the problem is that I want one (and only one) Panel control within my user control to act as a container where other controls can be placed in the form designer. I can set a designer attribute for the entire user control which causes the entire user control to be a container - but I only want one specific Panel control in the user control to act as a container. How can this be done? Please help, TIA :) /B -- modified at 5:29 Thursday 13th September, 2007
-
Hi, I'm developing a WinForms (VB.NET 2.0) application where I have a user control which contains several fixed controls (toolstrip, buttons, panels, etc.). This works just fine - the problem is that I want one (and only one) Panel control within my user control to act as a container where other controls can be placed in the form designer. I can set a designer attribute for the entire user control which causes the entire user control to be a container - but I only want one specific Panel control in the user control to act as a container. How can this be done? Please help, TIA :) /B -- modified at 5:29 Thursday 13th September, 2007
MrBean wrote:
I can set a designer attribute for the entire user control which causes the entire user control to be a container
My reply is off-topic a bit, but I have a problem. Please take a look: http://www.codeproject.com/script/comments/forums.asp?msg=2202335&forumid=1649&XtraIDs=1649&sd=15+Jun+2007&ed=13+Sep+2007&author=gajatko&stype=1#xx2202335xx It looks like you know how to make a user control to act as a container. Please help! Thanks in advance...
Greetings - Gajatko Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
-
MrBean wrote:
I can set a designer attribute for the entire user control which causes the entire user control to be a container
My reply is off-topic a bit, but I have a problem. Please take a look: http://www.codeproject.com/script/comments/forums.asp?msg=2202335&forumid=1649&XtraIDs=1649&sd=15+Jun+2007&ed=13+Sep+2007&author=gajatko&stype=1#xx2202335xx It looks like you know how to make a user control to act as a container. Please help! Thanks in advance...
Greetings - Gajatko Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
Getting a user control to act as a container is pretty easy : After creating a user control in VS 2005, the class code should look something like this:
Public Class MyUserControl1 End Class
Just add the following attribute to the class :< System.ComponentModel.Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", GetType(IDesigner)) > _ Public Class MyUserControl1 End Class
That should do the trick ;) If you (or anybody else) find a solution to my problem (read my first post in this thread), please let me know... PLEEEEEESE ;) /B -
Hi, I'm developing a WinForms (VB.NET 2.0) application where I have a user control which contains several fixed controls (toolstrip, buttons, panels, etc.). This works just fine - the problem is that I want one (and only one) Panel control within my user control to act as a container where other controls can be placed in the form designer. I can set a designer attribute for the entire user control which causes the entire user control to be a container - but I only want one specific Panel control in the user control to act as a container. How can this be done? Please help, TIA :) /B -- modified at 5:29 Thursday 13th September, 2007
Take a look at my TaskPane control, here: http://www.codeproject.com/useritems/MSOfficeTaskPane.asp[^] It does what you're asking. You can see how to set up the designer control properties to get everything to behave the way you want.
The early bird who catches the worm works for someone who comes in late and owns the worm farm. -- Travis McGee
-
Take a look at my TaskPane control, here: http://www.codeproject.com/useritems/MSOfficeTaskPane.asp[^] It does what you're asking. You can see how to set up the designer control properties to get everything to behave the way you want.
The early bird who catches the worm works for someone who comes in late and owns the worm farm. -- Travis McGee
Thanks for your post, but it doesn't help me. I only need a user control (not a custom control) where I can control which panel is the container for the .NET form designer. Also seems like the entire Taskpane control acts like the container and not just a limited area within (panel)... controls can be resized and moved to overlap the toolbarfor example. /B