Yamikuronue
Yamikuronue

Reputation: 758

Default windows forms resizing behavior

If I have created a forms app and not specified anything out of the ordinary (just used Visual Studio's designer to drag and drop controls), what behavior should I expect when resizing the window? Does it differ based on what controls I used? Is there detailed documentation of this someplace I can reference?

(I hate asking something so vague and contrived, but I don't have access to Visual Studio and the developers who do aren't being helpful. As far as I know they're using C# and not using any sort of layout panel.)

Upvotes: 1

Views: 1302

Answers (2)

Rob Jefferies
Rob Jefferies

Reputation: 254

Controls on a WinForm application do not resize by default. Look at using the Anchor property on controls. For example. If you want a button to widen when you widen a form go to the Anchor property on the button and anchor the left and right sides. This will widen the button as the form widens.

You can think of the anchor as the parts that get "pulled" when a form moves.

See this post: Auto size the controls in winform

Upvotes: 1

Bridge
Bridge

Reputation: 30711

It sounds to me like you need to know about anchoring and docking the various components, how they hold together, and how they behave when resizing the form. Please see this link for a guide on how to do this effectively, and how some of the various options work.

Upvotes: 1

Related Questions