Dropping Controls On To User Control At Design Time




I want to create a User Control that will be able to contain other controls - and to be able to drop those other controls on to the user control at design time.

I haven't managed to find anything by Googling - except a MSFT example (IToolboxUserExample) which compiles/runs but doesn't actually seem to do anything. I also found a brief example showing that this could be done by adding a custom designer, unfortunately although the dropped controls seemed to nest themselves on the User Control at design time they disappeared in a puff of smoke when I ran the app.

Is what I am trying to do actually possible? If so can anybody point me to a simple example/article that I can learn from and build on please? I have managed to build a class based on a Panel which does what I want but have had no success with a User Control.

--
Jeff Gaines Damerham Hampshire UK
All things being equal, fat people use more soap
.



Relevant Pages

  • Designer problem with inherited user control
    ... I have a user control called "View" with a nested panel that correctly ... "FunctionView" from View where I want to add more components at design time. ... the derived user control does not accept components when they are ... public partial class FunctionView: View ...
    (microsoft.public.dotnet.framework.windowsforms.designtime)
  • Re: How to set the description of user controls property
    ... This is a great design time article: ... > I am writting an user control. ... the properties will disply on the property windows and user ... > description about the user control property at the bottom of property ...
    (microsoft.public.dotnet.languages.csharp)
  • Error creating User control with Enterprise Library
    ... see the forms at design time, ... The section 'dataConfiguration' does not exist in the ... Most of the times it also deletes any reference to the user control from ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: User control jumps upon being clicked at design time?
    ... I then tried to select its instance on that form at design time (to ... the user control jumped - i.e. its position on the form ... Its new top left corner was the spot that I clicked. ... put in UserControl_Resize, but after commenting that code out, the ...
    (microsoft.public.vb.general.discussion)
  • Design Time instantiation of user control
    ... I have a user control that will not instantiate when I drop it on a form at ... design time, however, it will create fine at runtime. ... "Destination array was not long enough. ... instance of "destIndex" anywhere in my code. ...
    (microsoft.public.dotnet.general)

Loading