TAN WhoAMI

TAN WhoAMI

  • NA
  • 291
  • 0

How to resize the controls size when the window is Maximized

May 12 2013 10:29 PM
in C# Winforms, say I have several controls (labels, buttons, TextBox, ListBox, etc), and when the window is Maximized, I want those controls to be automatically resize to fit in the maximized windows, such that the position and size of those controls are in proportion when the windows is maximized. How do I achieve that? When the windows is maximized, isn't it that those texts in labels, buttons, Textbox, ListBox will automatically be increased proportionally? But I do not see that, even I try with different settings fro Anchor and Dock properties

I read from internet (http://www.techrepublic.com/article/manage-winform-controls-using-the-anchor-and-dock-properties/6165908)
about Anchor and Dock properties, but I try those and does not seem to work according to what I want.

I would also want the same solution for C# WPF.

thanks so much.

Some good examples would be helpful.

Answers (13)