I have a Custom WinForms UserControl. I would like to be able to drop other controls, like a CheckBox, on top of it during Design Time so that the dropped Control is now the child of my Custom Control. Any ideas on how to make this happen?
My simple Custom Control is defined as follows:
My simple Custom Control is defined as follows:
CustomeUserControl:
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Windows.Forms;
using System.Windows.Forms.Design;
namespace SlidingPanel
{
[Designer(typeof(SlidePanelDesigner))]
public partial class SlidePanel : UserControl
{
public SlidePanel()
{
InitializeComponent();
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public Label HeaderLabel { get { return Header; } }
}
class SlidePanelDesigner : ControlDesigner
{
public override void Initialize(IComponent comp)
{
base.Initialize(comp);
var uc = (SlidePanel)comp;
EnableDesignMode(uc.HeaderLabel, "HeaderLabel");
}
}
}