Derived Panel using PanelContainerDesigner accepts drop - but how can I respond to the drop?

My derived panel control accepts other controls dropped on it at design time -- but then how do I gather these dropped controls into some sort of collection and how do I interact with them programmatically at design time?  How do I "get to" these dropped controls that are now inside my derived panel?
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Web.UI.Design;
using System.Web.UI.Design.WebControls;
namespace AJAXEnabledWebApplication1
  ToolboxData("<{0}:GPBox runat=\"server\"></{0}:GPBox>")]
    public class GPBox : Panel
        public GPBox()
            this.BorderStyle = BorderStyle.Solid;
            this.BorderWidth = 1;
            this.Width = 300;
            this.Height = 300;
            GPBoxDesigner.WasClicked += null;
            GPBoxDesigner.WasClicked += new EventHandler(this.RespondToClick);
        private void RespondToClick(object sender, EventArgs e)
            string a = "responding to click";
        protected override void Render(HtmlTextWriter writer)
    public class GPBoxDesigner : PanelContainerDesigner
        public static event EventHandler WasClicked;
        private GPBox _gpb = null;
        private static bool clicked = false;
        public string _color = "Green";
        public override void Initialize(IComponent component)
            if (!(component is GPBox))
                throw new ArgumentException();
            _gpb = (GPBox)component;
        public override string GetDesignTimeHtml()
            string temp = "<div id='GPBox1' style='background-color:" + _color + ";border-width:1px;border-style:Solid;height:300px;width:300px;'>";
            //return string.Format(temp, _gpb.Style);
            return temp;
        public override bool AllowResize
                return true;
                //return base.AllowResize;
        // Provide a design-time caption for the panel.
        public override string FrameCaption
                // If the FrameCaption is empty, use the panel control ID.
                string localCaption = base.FrameCaption;
                if (localCaption == null || localCaption == "")
                    localCaption = ((Panel)Component).ID.ToString();
                return localCaption;
        } // FrameCaption
        // Provide a design-time border style for the panel.
        public override Style FrameStyle
                Style styleOfFrame = base.FrameStyle;
                // If no border style is defined, define one.
                if (styleOfFrame.BorderStyle == BorderStyle.NotSet ||
                    styleOfFrame.BorderStyle == BorderStyle.None)
                    styleOfFrame.BorderStyle = BorderStyle.Groove;
                return styleOfFrame;
        } // FrameStyle
        protected override void OnClick(DesignerRegionMouseEventArgs e)
            if (clicked == true)
                _color = "Red";
                _color = "Blue";
            clicked = !clicked;
            if (WasClicked != null)
                WasClicked(_color, null);

Open in new window

Tom KnowltonWeb developerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:

You can access to controls in the GPBoxDesigner with the AssociatedComponents property.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Could you post how you used the solution?  It would be good to know, thanks!
Tom KnowltonWeb developerAuthor Commented:
I haven't implemented it yet.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.