i'm new windows forms in visual studio, , wondering how automaticly resize controls window size.
say, have 2 controls in panel, list box , button. want button dock bottom, , want list box fit rest of space. when window resizes, button should @ bottom (as expected docking), , list box should stretch down button.
is there way without code?
thanks.
dock pretty easy use, recommend using anchor properties instead. resize form reasonable size in designer. then, place controls way want. then, decide controls should resize form , set anchor property follows:
- if want control resize form in width, set right anchor.
- if want resize height, set bottom anchor.
- if want control stay right when form resizes, unset left anchor.
- if want control stay bottom when form resizes, unset top anchor.
the problem have docks act funny when controls not declared in specific order, , effect want, have create extraneous panels hold controls.
Comments
Post a Comment