How can i use the tree view ?????????????
Hi guys
I don't know nothing about using tree view and i need ti use it in my application!
How can exemple:
i got in the treeview the name File
and when i click on it the tree open and show Open and Exit
and how when i press Open somehing hapen and when i press Exit something hapen??
I hope that u know what i mean
and please don't give me any comlicated exemples (i'm just a biginner :) )
Re: How can i use the tree view ?????????????
Here is an example:
VB Code:
Private Sub Form_Load()
TreeView1.Nodes.Add , , , "Item 1"
TreeView1.Nodes.Add , , , "Item 2"
TreeView1.Nodes.Add 2, tvwChild, , "Subitem 1"
TreeView1.Nodes.Add 2, tvwChild, , "Subitem 2"
TreeView1.Nodes.Add , , , "Item 3"
End Sub
Re: How can i use the tree view ?????????????
Quote:
Originally Posted by baja_yu
Here is an example:
VB Code:
Private Sub Form_Load()
TreeView1.Nodes.Add , , , "Item 1"
TreeView1.Nodes.Add , , , "Item 2"
TreeView1.Nodes.Add 2, tvwChild, , "Subitem 1"
TreeView1.Nodes.Add 2, tvwChild, , "Subitem 2"
TreeView1.Nodes.Add , , , "Item 3"
End Sub
Very Very Nice Man!
but how can i put a code for one of it
i meaN WHEN I CLICK ON ONE OF THIS NODS SOMETHING HAPEN..HOW?
but i still don't know how to do it to...
lets say that i have 3 Nods(if this is what you call them)
+FILE
open
exit
+EDIT
cut
paste
+HELP
about
help
how can i do something like that and how when i click on open
something hapen or on exit or....
Re: How can i use the tree view ?????????????
Here it is. Hope it's good. If you have any more questions shoot away.
VB Code:
Private Sub Form_Load()
TreeView1.Nodes.Add , , , "FILE"
TreeView1.Nodes.Add 1, tvwChild, , "Open"
TreeView1.Nodes.Add 1, tvwChild, , "Exit"
TreeView1.Nodes.Add , , , "EDIT"
TreeView1.Nodes.Add 4, tvwChild, , "Cut"
TreeView1.Nodes.Add 4, tvwChild, , "Paste"
TreeView1.Nodes.Add , , , "HELP"
TreeView1.Nodes.Add 7, tvwChild, , "About"
TreeView1.Nodes.Add 7, tvwChild, , "Help"
End Sub
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
Select Case Node
Case "Open"
MsgBox "Do Open"
Case "Exit"
MsgBox "Do Exit"
Case "Cut"
MsgBox "Do Cut"
Case "Paste"
MsgBox "Do Paste"
Case "About"
MsgBox "Do About"
Case "Help"
MsgBox "Do Help"
End Select
End Sub
1 Attachment(s)
Re: How can i use the tree view ?????????????
thx man..
But i have one last questions..
Look at the attachement photo..can't i remove the text to the left more..
and i don't want when i put the mouse on top of something exemple:when i put the mouse on top of the pastw word they put a tooltiptext with the name paste i don't want that!!
1 Attachment(s)
Re: How can i use the tree view ?????????????
Here is the project attached that I made. The items are moved all to the left
and there is not tooltip text.
Re: How can i use the tree view ?????????????
Quote:
Originally Posted by baja_yu
Here is the project attached that I made. The items are moved all to the left
and there is not tooltip text.
O man, I don't know how to thank you.. :wave:
But i notice that i can change the name of the nods during the runtime and i don't want that to happen :cry:
and on the first click 2 nod open togather or i don'r know what!!
Note: I replace your tree view with mine in my project
Re: How can i use the tree view ?????????????
Change the LabelEdit property of the control to disable editing of the nodes.
I am not sure what could be the reason for it opening two nodes at once...
Re: How can i use the tree view ?????????????
Quote:
Originally Posted by baja_yu
Change the LabelEdit property of the control to disable editing of the nodes.
I am not sure what could be the reason for it opening two nodes at once...
there is only 2 choises Normail and Automatic
chould i change it to Normal?
Re: How can i use the tree view ?????????????
It should be manual and automatic. In any case, dont have it sent on automatic. Automatic enables editing during runtime...
Re: How can i use the tree view ?????????????
don't double post. this is resolved in another thread.