Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto size the controls in winform

I've a winform and I placed a listbox in that form. When I maximize the winform the size of the list box remains same.

But I dont want like this. I want to adjust the size automatically.

Is there any default property for this?

Thank you, Nagu

like image 947
Nagu Avatar asked Oct 26 '09 08:10

Nagu


2 Answers

Look for the anchor properties. You can set the anchor to resize automatically following the form.

The anchor has 4 sides. If you anchor to all 4 sides, the control will retain its size ratio according to the size of its parent form.

like image 66
Andrew Keith Avatar answered Sep 27 '22 18:09

Andrew Keith


Use the .Anchor property.

like image 29
Dan Byström Avatar answered Sep 27 '22 20:09

Dan Byström