0

Are there any property of a form or a component by which components of windows applications created using Visual Studio will be arranged automatically when I changed the windows size or maximized - restored the window? If not, How can I do it manually?

chanchal1987
  • 2,320
  • 7
  • 31
  • 64
  • To clarify: you want to know if there's anything built into WinForms that'll remember your applications last window position? – Roger Lipscombe Sep 06 '10 at 10:06
  • @Roger Lipscombe: No... I want to know the property by which components of a form will automatically rearranged when I am changing the size of the form. – chanchal1987 Sep 06 '10 at 10:11
  • Oh, OK. You want to know how to automatically move/resize child windows when the parent window is resized? – Roger Lipscombe Sep 06 '10 at 12:34

1 Answers1

1

There are several. Starting with the Dock and Anchor properties of a control, good for simple layouts with no more than, say, 3 controls across. Then the TableLayoutPanel and FlowLayoutPanel controls, they automatically arrange the controls inside of them. Respectively in a grid and a flow layout.

For the really tough layout cases you could implement the form's Resize event and calculate Location and Size properties yourself. That's rarely necessary.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536