[英]How to remove blank spaces of treeview in c# winforms?
You can remove the left side space by setting ShowRootLines property to false
. 您可以通过将ShowRootLines属性设置为
false
来删除左侧空间。
But note that it will also remove the plus/minus from the root nodes, so the only way to expand/collapse them would be the double click or using keyboard. 但是请注意,它还会从根节点中删除加号/减号,因此展开/折叠它们的唯一方法是双击或使用键盘。
It is the Property Indent that you want to change: 您要更改的是属性缩进 :
treeView1.Indent = 5;
Also, ShowPlusMinus takes some of the space, if you want you can remove it: 另外, ShowPlusMinus会占用一些空间,如果您愿意,可以将其删除:
treeView1.ShowPlusMinus = false;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.