Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - TreeView Nodes Problem!!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

TreeView Nodes Problem!!

 Post Reply Post Reply
Author
Message
ViperSnake View Drop Down
Newbie
Newbie


Joined: 13 March 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote ViperSnake Quote  Post ReplyReply Direct Link To This Post Topic: TreeView Nodes Problem!!
    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...

Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2008 at 1:15am
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....
Back to Top
ViperSnake View Drop Down
Newbie
Newbie


Joined: 13 March 2008
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote ViperSnake Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2008 at 7:23am
Tks for the help...I ended up solving the problem by giving focus to the treeview on the node click event!


Tks again..
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.187 seconds.