Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,289 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
hi, how to make treeview with node symbol as + symbol (instead of triangle) which converts to - symbol when expanded, and how to add lines (dash lines) that makes it easy to follow the intendations of the tree.
thanks in advance
You can use Shape.StrokeDashArray to draw dotted lines for the TreeViewItems.You can replace the HorLn and VerLn in the demo which provided by Castorix31 like below:
<!-- Connecting dotted Lines -->
<!-- Horizontal line -->
<Rectangle x:Name="HorLn" Height="1" VerticalAlignment="Center" StrokeDashArray="4 4" HorizontalAlignment="Stretch" Stroke="#8888" Margin="9,0,0,0" SnapsToDevicePixels="True"/>
<!-- Vertical line -->
<Rectangle x:Name="VerLn" Width="1" VerticalAlignment="Stretch" StrokeDashArray="4 4" HorizontalAlignment="Center" Stroke="#8888" Grid.RowSpan="2" SnapsToDevicePixels="True"/>
Here is the whole code for you to test.
You can see for example : WPF TreeView with WinForms Style Fomat