UserControl and how to add controls to it
-
Hi, i've built a UserControl which has a panel in it, I wish to be able to add controls into it at design-time. I've tried to do it simple; just built the control, compiled it into a DLL and add it to the ToolBox, then i've drag it to my WinForm. The control is visible and all its properties are working great. but when i try to add a control into it (say a link labal), the control does not get added! i see the outlines selections, with nothing inside (i.e. the text, color etc.) and when compiling and running the WinForm, the link does not appear. any idea? thanks guys
-
Hi, i've built a UserControl which has a panel in it, I wish to be able to add controls into it at design-time. I've tried to do it simple; just built the control, compiled it into a DLL and add it to the ToolBox, then i've drag it to my WinForm. The control is visible and all its properties are working great. but when i try to add a control into it (say a link labal), the control does not get added! i see the outlines selections, with nothing inside (i.e. the text, color etc.) and when compiling and running the WinForm, the link does not appear. any idea? thanks guys
-
Hi guys, it me again. I've looked at MS KB 813450, and it didn't fix my problem. which is realy weird... maybe i'm doing something wrong?
-
Hi, i've built a UserControl which has a panel in it, I wish to be able to add controls into it at design-time. I've tried to do it simple; just built the control, compiled it into a DLL and add it to the ToolBox, then i've drag it to my WinForm. The control is visible and all its properties are working great. but when i try to add a control into it (say a link labal), the control does not get added! i see the outlines selections, with nothing inside (i.e. the text, color etc.) and when compiling and running the WinForm, the link does not appear. any idea? thanks guys
hai there, I think the above mentioned steps are that you following to build your application. am i right ?. If yes it won't show any unexpected out put. The way that you are following is correct. I think the problem is because of properties of controls that you are using here. I tried this same thing and i never found any problem. If you want code block that i tried.then please let me know. hai, enjoy coding Sreejith SS Nair
-
Hi, i've built a UserControl which has a panel in it, I wish to be able to add controls into it at design-time. I've tried to do it simple; just built the control, compiled it into a DLL and add it to the ToolBox, then i've drag it to my WinForm. The control is visible and all its properties are working great. but when i try to add a control into it (say a link labal), the control does not get added! i see the outlines selections, with nothing inside (i.e. the text, color etc.) and when compiling and running the WinForm, the link does not appear. any idea? thanks guys
The
Panel
should be either protected or public (by default, the VS.NET designer makes these private). If it is not, it is not a separately designable container - it's just another part of yourUserControl
. If you find that it does not work, you need to attribute yourUserControl
with aParentControlDesigner
derivative that allows controls to be added. You can find out more about this designer class in the .NET Framework SDK. Both suggestion should work, however. I helped another guy with a similar problem about a month ago and the problem was resolved using one (or both) of these methods. You could always try searching the comments (see the "Search comments" link ago) for keywords like "ParentControlDesigner" for more information on that discussion.Microsoft MVP, Visual C# My Articles
-
Hi, i've built a UserControl which has a panel in it, I wish to be able to add controls into it at design-time. I've tried to do it simple; just built the control, compiled it into a DLL and add it to the ToolBox, then i've drag it to my WinForm. The control is visible and all its properties are working great. but when i try to add a control into it (say a link labal), the control does not get added! i see the outlines selections, with nothing inside (i.e. the text, color etc.) and when compiling and running the WinForm, the link does not appear. any idea? thanks guys
Thanks guys for the quick help. the fixed the problem by removing the panel that was fill-docking my user control and adding the ParentControlDesigner attribute. Now the controls are being added into the user control and not to one of its controls (i.e. the panel i wanted it to be added to). thanks.