开发者_StackOverflowI am intersted whather I can make controls like treeview, RTF or tabcontrols resizable (I guess I can) and how. I know about using splitters but those only enable to make two areas to "overlap". Thank you!
You can set the control's Dock
property to Fill
. This will cause the control to fill it's parent container.
You may still need to write some code to handle laying out the child controls. You can either do this by handling the Resize
event, or by using a container that supports resizing for you (such as FlowLayoutPanel
or TableLayoutPanel
).
The easiest way is to anchor the controls to the container they are in. Then, when the container is resized, the controls will be resized as well. Check out the Anchor property of the controls. You can set the control to anchor to the left, right, top, bottom of the container or any combination of those.
精彩评论