Re: Dropping Controls On To User Control At Design Time



Hi,

Jeff Gaines wrote:

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.

Your control will need to inherit from ContainerControl.

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.

Check out this article, it should get you started:
http://www.codeproject.com/KB/toolbars/MSOfficeTaskPane.aspx

Cheers,
Olaf
.



Relevant Pages

  • Re: Custom Server Control Cant read design time property
    ... Microsoft Online Support ... | Subject: Re: Custom Server Control Can't read design time property ... |> ViewState, so at that time the ViewState of the control is still ... |> | Subject: Re: Custom Server Control Can't read design time property ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: CompositeControl fails to display in Design view
    ... protected override void CreateChildControls() ... I then view the page with the broken control on it and nothing happens? ... if you follow the instructions then that is how you can debug the designer. ... It is the design time experience that is not working. ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Re: RunTime forms with modules...
    ... I realized that what I was trying to do was mix design time operation with ... while still being able to allow design time operations of ... different prefix each control in a group of controls. ... intNext = intNext + 1 ...
    (microsoft.public.access.modulesdaovba)
  • Re: now i can debug my tabcontrol, now what?
    ... After reading the article I was able to set up an environment for debugging ... derived class from the control collection. ... >> This happens during design time when i go to add the tabPage using the ... >> TabPageCollection, and a TabPage. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Why must I paint the form background for an owner-draw control?
    ... I still get a black background around the owner-drawn control. ... > You mentioned that at the native Windows level, ... > my button still occupies its entire bounding rectangle, ... > specified for the button at design time. ...
    (microsoft.public.dotnet.framework.windowsforms)

Loading