Using anchor property with dynamically added controls
Posted
by tcube
on Stack Overflow
See other posts from Stack Overflow
or by tcube
Published on 2009-05-03T18:07:39Z
Indexed on
2010/05/04
10:48 UTC
Read the original article
Hit count: 161
I'm adding some textboxes to a form dynamically at runtime. Everything works fine i.e. the textboxes are aligned, anchored and automatically resizes until the form is maximized. On maximizing the form, the textboxes are added to the same location while the form was not maximized. This causes a misalignment of the textboxes.
How can I ensure that all the textboxes are at the same location and of the same size both while the windowstate is normal as well as maximized?
EDIT:
Btw I'm using C#
EDIT:
Would a flowlayoutpanel be useful here?
© Stack Overflow or respective owner