Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: VB.NET
I have a treeview in winwoforms. It has one root and four child nodes.
Using mouseclick event, I need to take index of the selected node but the problem with me is, it displays the index of root node only, even if I click root node or any of the child node, it display index as 0
I want to identify if user clicked the root node or child node.
Please advise.
Posted 8-Jan-13 21:44pm
Sandeep Mewara at 9-Jan-13 4:04am
You should have shared your related code snippet that is troubling you.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

As far as I know, the TreeView class has no selected index property.
If you need the SelectedNode reference, you may handle the AfterSelect event.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 324
1 Maciej Los 239
2 Sergey Alexandrovich Kryukov 182
3 CPallini 120
4 Richard MacCutchan 120
0 OriginalGriff 5,474
1 Sergey Alexandrovich Kryukov 4,713
2 Peter Leow 2,944
3 DamithSL 2,465
4 Maciej Los 2,434

Advertise | Privacy | Mobile
Web01 | 2.8.140718.1 | Last Updated 9 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid