Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Tree View (sorry guys dont get mad)

Tree View (sorry guys dont get mad)

Scheduled Pinned Locked Moved Visual Basic
questiondata-structures
16 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Paul Conrad

    Christian Graus wrote:

    I don't believe the nodes themselves have events, no. Having one event call different methods based onthe node selected seems nicer to me, anyhow.

    Okay. Was just wondering if there were more than one way of doing this. Your solution sounds quick and easy :-D ---mod I like how Dilbert was going on about Six Sigma :laugh:

    Last modified: 1min after originally posted --


    If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa

    C Offline
    C Offline
    Code Crapper
    wrote on last edited by
    #6

    Quote ---------------- The tree control has an event when the selected node is changed. You catch that, work out what node is selected, and show your contents accordingly. Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert Quote ---------------- Um guys I still need help?!?!?? What event.. Catch?.. event..? :confused: Can someone give me a code snippet because I'm the type of person that learns how to code from code snippets and then experiments with it. I am stuck here with a tree view and a panel thats not doing anything.... Many thanks

    --------------------------- If I had a £0.01 for the amount of times I have said to people "USE GOOGLE" I would be richer than Bill Gates.

    P 1 Reply Last reply
    0
    • C Code Crapper

      Quote ---------------- The tree control has an event when the selected node is changed. You catch that, work out what node is selected, and show your contents accordingly. Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert Quote ---------------- Um guys I still need help?!?!?? What event.. Catch?.. event..? :confused: Can someone give me a code snippet because I'm the type of person that learns how to code from code snippets and then experiments with it. I am stuck here with a tree view and a panel thats not doing anything.... Many thanks

      --------------------------- If I had a £0.01 for the amount of times I have said to people "USE GOOGLE" I would be richer than Bill Gates.

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #7

      Try using the NodeDoubleClick event procedure ... Private Sub TreeView1_NodeMouseDoubleClick( .... ) Handles TreeView1.NodeMouseDoubleClick GroupBox1.Text = TreeView1.SelectedNode.Text End Sub


      If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa

      C 1 Reply Last reply
      0
      • P Paul Conrad

        Try using the NodeDoubleClick event procedure ... Private Sub TreeView1_NodeMouseDoubleClick( .... ) Handles TreeView1.NodeMouseDoubleClick GroupBox1.Text = TreeView1.SelectedNode.Text End Sub


        If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa

        C Offline
        C Offline
        Code Crapper
        wrote on last edited by
        #8

        I tried that but at the end (the bit thats in bold) it says the signitures are not the same :confused: Its underlined in blue saying it :( Private Sub TreeView1_NodeMouseDoubleClick( .... ) Handles TreeView1.NodeMouseDoubleClick

        --------------------------- If I had a £0.01 for the amount of times I have said to people "USE GOOGLE" I would be richer than Bill Gates.

        P 1 Reply Last reply
        0
        • C Code Crapper

          I tried that but at the end (the bit thats in bold) it says the signitures are not the same :confused: Its underlined in blue saying it :( Private Sub TreeView1_NodeMouseDoubleClick( .... ) Handles TreeView1.NodeMouseDoubleClick

          --------------------------- If I had a £0.01 for the amount of times I have said to people "USE GOOGLE" I would be richer than Bill Gates.

          P Offline
          P Offline
          Paul Conrad
          wrote on last edited by
          #9

          Try to create the event procedure through the Properties window...


          Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon

          C 1 Reply Last reply
          0
          • P Paul Conrad

            Try to create the event procedure through the Properties window...


            Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon

            C Offline
            C Offline
            Code Crapper
            wrote on last edited by
            #10

            What am I looking for in the properties panel? (sorry about this I'm just real tired and my eyes are fuzzy) ugh... what have i gotta change in the properties panel? Is it that tag field or is it something in the node properties somewhere?

            --------------------------- If I had a £0.01 for the amount of times I have said to people "USE GOOGLE" I would be richer than Bill Gates.

            P 1 Reply Last reply
            0
            • C Code Crapper

              What am I looking for in the properties panel? (sorry about this I'm just real tired and my eyes are fuzzy) ugh... what have i gotta change in the properties panel? Is it that tag field or is it something in the node properties somewhere?

              --------------------------- If I had a £0.01 for the amount of times I have said to people "USE GOOGLE" I would be richer than Bill Gates.

              P Offline
              P Offline
              Paul Conrad
              wrote on last edited by
              #11

              What version of Visual Studio are you using?


              Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon

              C 1 Reply Last reply
              0
              • P Paul Conrad

                What version of Visual Studio are you using?


                Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon

                C Offline
                C Offline
                Code Crapper
                wrote on last edited by
                #12

                I'm using Visual Basic 2005 .. OH NO... i can do it in VB cant I ?!?!?! :wtf:

                --------------------------- If I had a £0.01 for the amount of times I have said to people "USE GOOGLE" I would be richer than Bill Gates.

                P 1 Reply Last reply
                0
                • C Code Crapper

                  I'm using Visual Basic 2005 .. OH NO... i can do it in VB cant I ?!?!?! :wtf:

                  --------------------------- If I had a £0.01 for the amount of times I have said to people "USE GOOGLE" I would be richer than Bill Gates.

                  P Offline
                  P Offline
                  Paul Conrad
                  wrote on last edited by
                  #13

                  Code Crapper wrote:

                  i can do it in VB cant I ?!?!?! :wtf:

                  Yes. Because I did :rolleyes: For the Treeview, under Events icon, there should be one called NodeMouseDoubleClick, use that one...


                  Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon

                  C 1 Reply Last reply
                  0
                  • P Paul Conrad

                    Code Crapper wrote:

                    i can do it in VB cant I ?!?!?! :wtf:

                    Yes. Because I did :rolleyes: For the Treeview, under Events icon, there should be one called NodeMouseDoubleClick, use that one...


                    Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon

                    C Offline
                    C Offline
                    Code Crapper
                    wrote on last edited by
                    #14

                    THANK YOU I LOVE YOU!!!! LOL (sorry thats not normally me) Anyway, since I have done that, will it now make it so that the group box will show the properties just for the node I have clicked on and then when I click on another node it should clear the properties of the last one and then show this new nodes properties? (sorry if thats a bit confusing) EDIT Damn.. I just ran into a new prob In editing mode I cant select nodes so how can I make the properties for each node in 1 group box :S :sigh: EDIT 2 Damn.. again, I just relised that just changes the group box text not whats in the group box.. how do I change whats in the group box :S.. my god this thread is getting big.... SORRY EVERYBODY -- modified at 21:26 Sunday 26th November, 2006

                    --------------------------- If I had a £0.01 for the amount of times I have said to people "USE GOOGLE" I would be richer than Bill Gates.

                    P 1 Reply Last reply
                    0
                    • C Code Crapper

                      THANK YOU I LOVE YOU!!!! LOL (sorry thats not normally me) Anyway, since I have done that, will it now make it so that the group box will show the properties just for the node I have clicked on and then when I click on another node it should clear the properties of the last one and then show this new nodes properties? (sorry if thats a bit confusing) EDIT Damn.. I just ran into a new prob In editing mode I cant select nodes so how can I make the properties for each node in 1 group box :S :sigh: EDIT 2 Damn.. again, I just relised that just changes the group box text not whats in the group box.. how do I change whats in the group box :S.. my god this thread is getting big.... SORRY EVERYBODY -- modified at 21:26 Sunday 26th November, 2006

                      --------------------------- If I had a £0.01 for the amount of times I have said to people "USE GOOGLE" I would be richer than Bill Gates.

                      P Offline
                      P Offline
                      Paul Conrad
                      wrote on last edited by
                      #15

                      Code Crapper wrote:

                      how do I change whats in the group box

                      Just apply whatever changes you want to the controls in the group box based on the node that is selected... Put in a value in the Tag property for each node, so when the NodeMouseDoubleClick event is triggered, you know which node the user double clicked.


                      If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa

                      C 1 Reply Last reply
                      0
                      • P Paul Conrad

                        Code Crapper wrote:

                        how do I change whats in the group box

                        Just apply whatever changes you want to the controls in the group box based on the node that is selected... Put in a value in the Tag property for each node, so when the NodeMouseDoubleClick event is triggered, you know which node the user double clicked.


                        If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa

                        C Offline
                        C Offline
                        Code Crapper
                        wrote on last edited by
                        #16

                        Thanks! :-D Just one more thing im not sure about? when I click on the next node, the controls from the old node are still showing, cant I make it so that when the new node is double clicked the old nodes properties dissapear and the new nodes properties appear? E.g First node has a text box and a combo box in the group box and then when i double click another node the group box hides the textbox and combo box and then displays just a list box (or whatever)

                        --------------------------- If I had a £0.01 for the amount of times I have said to people "USE GOOGLE" I would be richer than Bill Gates.

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups