简体   繁体   中英

TreeView/TreeViewItem ControlTemplates with dotted lines

This seems like it should have such a simple solution, but apparently it doesn't.

I've searched far and wide, and there apparently seems to be no way of adding dotted lines to connect nodes in a TreeView , unlike the WinForms equivalent.

I've found a number of sources online where people have changed the ControlTemplate to one which has the connecting lines. However, when reading through the comments and discussions they all seem to have problems.

How would I go about changing the ControlTemplate to achieve this?

As promised I wrote the Control Template to make a WPF TreeView look like the Winform TreeView.

You'll find all the code and files here or here !

Enjoy !

在此输入图像描述

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