I test the method that provide in the SO thread, and it works fine. Here is a workaround you can refer to.
We can replace the FlowLayoutPanel with a custom FlowLayoutPanel class.
Parent.Designer.cs:
partial class Form1
{
// Code omitted
// …
private void InitializeComponent()
{
flowLayoutPanel1 = new FlowLayoutPanelHeritable();
this.SuspendLayout();
//
// flowLayoutPanel1
//
flowLayoutPanel1.Location = new System.Drawing.Point(24, 12);
flowLayoutPanel1.Name = "flowLayoutPanel1";
flowLayoutPanel1.Size = new System.Drawing.Size(285, 174);
flowLayoutPanel1.TabIndex = 0;
// Code omitted
// …
}
// declare a custom FlowLayoutPanel
public FlowLayoutPanelHeritable flowLayoutPanel1;
public System.Windows.Forms.Button button1;
}
// Custom FlowLayoutPanel inherited from FlowLaypitPanel
[Designer(typeof(ParentControlDesigner))]
public class FlowLayoutPanelHeritable : FlowLayoutPanel
{
}
Hope this can help you.