Link to home
Start Free TrialLog in
Avatar of mailsuhail
mailsuhail

asked on

need a code

i have made a treeview box. how do i  select a node from that treeview so that it will print some text in the text box.and also if i select another node it should print another text in the same text box below the first one( in next line)
Avatar of waty
waty
Flag of Belgium image

Use the following text as a start

Private Sub treeDatabase_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

   If treeDatabase.SelectedItem Is Nothing Then Exit Sub

   If (Button = vbRightButton) Then
      treeDatabase.SelectedItem = treeDatabase.HitTest(X, Y)
           
      If treeDatabase.SelectedItem Is Nothing Then Exit Sub
           
      If treeDatabase.SelectedItem.Parent Is Nothing Then
         ' *** Popup for categories
     
      Else
         ' *** Popup for items
     
      End If
   End If

End Sub

Public Sub treeDatabase_NodeClick(ByVal Node As ComctlLib.Node)

   If treeDatabase.SelectedItem Is Nothing Then Exit Sub
   
   tbTexbox1.Text = tbTexbox1.Text & "Your Text"

End Sub
Avatar of mailsuhail
mailsuhail

ASKER

answer may be correct but too complicated for me to understand.
ASKER CERTIFIED SOLUTION
Avatar of hakyemez
hakyemez
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial