The blog post in @nobugz answer is excellent. Thought the following vb example may help others.
Create your user control as normal.
In this example the control name is HorizontalCollapsiblePanel and the ContentPanel is panel to be exposed to the designer.
Add designer attribute to the class statement.
<System.ComponentModel.Designer(GetType(HorizontalCollapsiblePanel.Designer))> _
Public Class HorizontalCollapsiblePanel
Create a readonly property to the panel to be exposed.
<System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)> _
Public ReadOnly Property Content() As Panel
Get
Return Me.ContentPanel
End Get
End Property
Create a class within the HorizontalCollapisblePanel class for use by the designer.
Public Class Designer
Inherits System.Windows.Forms.Design.ControlDesigner
Public Overrides Sub Initialize(ByVal component As System.ComponentModel.IComponent)
MyBase.Initialize(component)
EnableDesignMode(DirectCast(component, HorizontalCollapsiblePanel).Content, "Content")
End Sub
End Class
Note that System.Windows.Forms.Design.ControlDesigner requires a reference to System.Design.dll.