On the main form, there is an element of the panel that the “user control” is loaded into it; when you expand the window to full screen, the elements inside the control do not stretch.

Here is the code snippet where the control connects:

private void kontr_btn_Click(object sender, EventArgs e) { kontr_control kontr = new kontr_control(); content.Controls.Clear(); content.Controls.Add(kontr); } 

How to stretch elements inside a child control when expanding a window?

  • Anchors, if it is WinForms - Sublihim
  • are already on display everywhere, but it doesn't help - Artneo

1 answer 1

kontr.Dock = DockStyle.Fill; stretches the control over the entire available area of ​​the parent

  • thanks, helped - Artneo