I have this form, with a tab control and a listbox inside:
When I resize the window's height, I get something like this:
However, I actually wanted the tab control and the listbox to resize along, having the following result:
I believe I could achieve this effect by just responding to some kind of onResize()
method in the form, and do my own calculations to manually update the size of the tab control and the listbox accordingly.
However, I've seen many applications achieve this effect, so I suspect there is actually a better way to do so - perhaps a builtin feature.
Do you know a better way to achieve this effect?
Here is a good tutorial that explains how to resize winform controls on resizing the container form control using the dock and anchor properties:
http://www.techrepublic.com/article/manage-winform-controls-using-the-anchor-and-dock-properties/6165908
Setting the four values of the anchor property(top,right,bottom,left), you can make your control's edges to stay stationary with respect to the Form control even when it is re-sized.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With