TreeView Nodes Problem!! |
Post Reply |
Author | |
ViperSnake
Newbie Joined: 13 March 2008 Status: Offline Points: 3 |
Post Options
Thanks(0)
Posted: 17 May 2008 at 2:47pm |
I'm having a problem using the treeview control present on the Xtreme Suite Controls ActiveX Control v11.2.
When I select a node using the node_click event to open a form, the program always opens the first and the last nodes on the treeview. So when I click to open a form, the program opens that form and two other more, that are related to the first and last nodes on the treeview. Here is the code: Private Sub Form_Load() Set treeTest.Icons = ImageManager.Icons treeTest.Nodes.Add , , , "Test1", 1 treeTest.Nodes.Add , , , "Test2", 2 treeTest.Nodes.Add , , , "Test3", 3 End Sub Private Sub treeTest_NodeClick(ByVal Node As XtremeSuiteControls.TreeViewNode) Select Case Node.Index Case "1": frm1.Show Case "2": frm2.Show Case "3": frm3.Show End Select End Sub Am I doing this the right way? This code works fine with vb treeview... Tks... |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
There nothing wrong with your code. The Node.Index is long but that won't make a difference.
Only:
When you click the treeview it will get the focus and a treeview item will be selected > NodeClick event will fire.
If you would click the second node (when the treeview hasn't got the focus yet) the treeview gets the focus and first node will be selected (Nodeclick event fires and frm1 will be loaded) after this the click on node 2 or 3 will trigger another NodeClick event.
Try to add a dummy node first (this will have index 1) and change the cases in the NodeClick event and try again or run in debug mode you can see what I explained.
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
ViperSnake
Newbie Joined: 13 March 2008 Status: Offline Points: 3 |
Post Options
Thanks(0)
|
Tks for the help...I ended up solving the problem by giving focus to the treeview on the node click event!
Tks again.. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |