I am new to winforms, what i am trying to do is a simple form:
In my form there is a panel.
The panel is linked to a user control
The user control should fill the panel.
This is my form:
public Form1()
{
InitializeComponent();
UserControl1 userControl = new UserControl1();
panel1.Controls.Add(userControl);
userControl.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom)
| AnchorStyles.Left) | AnchorStyles.Right)));
userControl.Dock = DockStyle.Fill;
}
Not working -> the control doest stretch