I need help docking in winforms, I googled everywhere and nothing works, somebody please tell me whats wrong, the panel and lable doesn't appear, Please do not judge im new to C#.
public void doDock()
{
string[] test = { "g", "x", "l" };
foreach(string p in test)
{
Panel pnl = new Panel();
pnl.Dock = DockStyle.Top;
this.dockpanel.Controls.Add(pnl);
//
Label namelabel = new Label();
namelabel.Location = pnl.Location;
namelabel.Text = p;
this.Controls.Add(pnl);
}
}