0

How can I display a group box in the middle of the main Form?

It shows in the middle when the form is still in the default size, but once I maximize the size of the form (clicking on the maximize box) it displays in the right top corner of the form!

stuartd
  • 70,509
  • 14
  • 132
  • 163
Cru Dy
  • 51
  • 1
  • 9
  • Do you want it to stretch and fill the form when expanded? If so just set the `Dock` property to `fill` – Steve Apr 15 '16 at 10:16
  • But What About Labels and others stuffs inside the box it doesnt change – Cru Dy Apr 15 '16 at 10:18
  • 2
    Then you need to look at the `Anchor` properties of those controls. – Steve Apr 15 '16 at 10:18
  • 1
    Play around with the `Anchor` property. If you anchor it on all sides, it will grow and shrink when the form grows and shrinks. If you anchor it on no sides (all off) it should keep its relative position. – Dennis_E Apr 15 '16 at 10:18
  • 1
    I think several solutions to your issue was given there: http://stackoverflow.com/questions/491399/centering-controls-within-a-form-in-net-winforms – Nick Apr 15 '16 at 10:20
  • Yes ! thanks it keeps its relative position ! , thank you ! – Cru Dy Apr 15 '16 at 10:20

0 Answers0