Results 1 to 11 of 11

Thread: How can i use the tree view ?????????????

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    120

    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 )

  2. #2
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: How can i use the tree view ?????????????

    Here is an example:

    VB Code:
    1. Private Sub Form_Load()
    2.     TreeView1.Nodes.Add , , , "Item 1"
    3.     TreeView1.Nodes.Add , , , "Item 2"
    4.     TreeView1.Nodes.Add 2, tvwChild, , "Subitem 1"
    5.     TreeView1.Nodes.Add 2, tvwChild, , "Subitem 2"
    6.     TreeView1.Nodes.Add , , , "Item 3"
    7. End Sub

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    120

    Re: How can i use the tree view ?????????????

    Quote Originally Posted by baja_yu
    Here is an example:

    VB Code:
    1. Private Sub Form_Load()
    2.     TreeView1.Nodes.Add , , , "Item 1"
    3.     TreeView1.Nodes.Add , , , "Item 2"
    4.     TreeView1.Nodes.Add 2, tvwChild, , "Subitem 1"
    5.     TreeView1.Nodes.Add 2, tvwChild, , "Subitem 2"
    6.     TreeView1.Nodes.Add , , , "Item 3"
    7. 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....
    Last edited by Shady Soft; Feb 20th, 2005 at 05:53 AM.

  4. #4
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    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:
    1. Private Sub Form_Load()
    2.     TreeView1.Nodes.Add , , , "FILE"
    3.     TreeView1.Nodes.Add 1, tvwChild, , "Open"
    4.     TreeView1.Nodes.Add 1, tvwChild, , "Exit"
    5.     TreeView1.Nodes.Add , , , "EDIT"
    6.     TreeView1.Nodes.Add 4, tvwChild, , "Cut"
    7.     TreeView1.Nodes.Add 4, tvwChild, , "Paste"
    8.     TreeView1.Nodes.Add , , , "HELP"
    9.     TreeView1.Nodes.Add 7, tvwChild, , "About"
    10.     TreeView1.Nodes.Add 7, tvwChild, , "Help"
    11. End Sub
    12.  
    13. Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
    14.     Select Case Node
    15.         Case "Open"
    16.             MsgBox "Do Open"
    17.         Case "Exit"
    18.             MsgBox "Do Exit"
    19.         Case "Cut"
    20.             MsgBox "Do Cut"
    21.         Case "Paste"
    22.             MsgBox "Do Paste"
    23.         Case "About"
    24.             MsgBox "Do About"
    25.         Case "Help"
    26.             MsgBox "Do Help"
    27.     End Select
    28. End Sub

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    120

    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!!
    Attached Images Attached Images  

  6. #6
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    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.
    Attached Files Attached Files

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    120

    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..
    But i notice that i can change the name of the nods during the runtime and i don't want that to happen
    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
    Last edited by Shady Soft; Feb 20th, 2005 at 11:42 AM.

  8. #8
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Question 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...

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    120

    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?

  10. #10
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    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...

  11. #11
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: How can i use the tree view ?????????????

    don't double post. this is resolved in another thread.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width