简体   繁体   中英

How to prevent panel from changing its children controls' sizes

I have a panel which is hosting a Treeview and a User Control. The panel itself is residing within a window form. When I maximize the window form, the panel size get changed automatically and the Treeview within it.

Is there a way to prevent the panel from changing the children control within it automatically?

I am using visual studio 2008 and C# language.

Thanks

Set the TreeView .Anchor property to None. If the .Dock property has a value set it to None also. These two properties represent auto-resize features of a control relevant its parent container (which in your case is the Panel)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM