I have a form with several controls. The issue is that when I maximize the form to assume the screen resolution the controls do not scale correctly.
My Code:
private void Form1_Load(object sender, EventArgs e)
{
foreach (Control control in this.Controls)
{
control.Anchor =
((System.Windows.Forms.AnchorStyles)
((((System.Windows.Forms.AnchorStyles.Top |
System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
}
this.Location = new Point(0, 0);
this.Size = Screen.PrimaryScreen.WorkingArea.Size;
}
I have researched the problem for a few hours now and I have found the adjusting the anchor styles to Top, Bottom, Left, Right so that the controls will be resized along with the form. I have tried that with the code above and it has not helped. Setting DockSytle to DockStyle.Fill does not help either. If anyone could offer a suggestion of what would help me it would be greatly appreciated.