• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 508
  • Last Modified:

How to disable root lines, but keep plus/minus box for root nodes in a TreeView in VB.NET?

I'm currently implementing a navigation menu using a TreeView control.

I would like to use headers to group the items in the menu and make it possible to collapse these groups of items so that only the header is visible. Also there is a need for an indicator to let the user know the header is collapsed such as the [+] by setting the .ShowPlusMinus property to true. However there should be no lines between the root nodes (the headers).

Logically I thought I could obtain this by setting the below TreeView properties:

.ShowLines = True
.ShowPlusMinus = True
.ShowRootLines = False

Open in new window


But when I do this, the plusminus indicator disappears as it is apparantle part of the root lines (even though it makes no sense that they should be).

Is there a way to implement it so that root lines are deactivated, but the collapsed [+] indicator as well as child lines are activated?
0
andreas_rafn
Asked:
andreas_rafn
1 Solution
 
CodeCruiserCommented:
0
 
andreas_rafnAuthor Commented:
It looks really good, but I'll try to keep it simple considering the next ones that'll have to do the maintenance when I'm done with it - its for internal company use.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now