简体   繁体   中英

How to add padding between the TreeView control's contents and its edges

I want to add padding between the TreeView control's contents and its edge in windows form application?

This is referred to as a "margin" ( padding is inside, margin is outside ).

填充和边距视觉

TreeView.Margin property :

Gets or sets the space between controls.

However, if your TreeView is docked it will not respect this setting:

Setting the Margin property on a docked control has no effect on the distance of the control from the the edges of its container.

So you would have to place your TreeView in a Panel , dock the Panel and put the margin on the TreeView .

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