Treeview with link

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nurikoAnna
    New Member
    • Nov 2008
    • 26

    Treeview with link

    How to use a treeview when I click the node a form will show to the screen...

    please help me...thanks God bless...
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Are you fetching any data from database and want to display on a form ?

    or you want to open a new form each time you click on a new node ?

    Comment

    • QVeen72
      Recognized Expert Top Contributor
      • Oct 2006
      • 1445

      #3
      Hi,

      In node click event, depending on the node caption , call the form..
      Something like this :

      [code=vb]
      If TrVw.SelectedIt em.Text = "Customers" Then
      frmCustomers.Sh ow
      Elseif TrVw.SelectedIt em.Text = "Orders" Then
      frmOrders.Show
      End If
      [/code]

      REgards
      Veena

      Comment

      • nurikoAnna
        New Member
        • Nov 2008
        • 26

        #4
        Originally posted by debasisdas
        Are you fetching any data from database and want to display on a form ?

        or you want to open a new form each time you click on a new node ?

        I want to open a new form each time I click on a new node...

        Comment

        • nurikoAnna
          New Member
          • Nov 2008
          • 26

          #5
          Originally posted by QVeen72
          Hi,

          In node click event, depending on the node caption , call the form..
          Something like this :

          Expand|Select|W rap|Line Numbers
          1. If TrVw.SelectedIt em.Text = "Customers" Then
          2. frmCustomers.Sh ow
          3. Elseif TrVw.SelectedIt em.Text = "Orders" Then
          4. frmOrders.Show
          5. End If






          REgards
          Veena


          where can I find node event???
          Do I have to declare some variable because i got this error on the first line
          "object variable or with block variable not set"

          Is costumer a name for a node???

          Comment

          • QVeen72
            Recognized Expert Top Contributor
            • Oct 2006
            • 1445

            #6
            Hi,

            On your Form, Double Click the TreeView, and from event's list, Select the NodeClick event..
            From my code, change the name of Control Treeview , Give your control name accordingly..

            Regards
            Veena

            Comment

            • nurikoAnna
              New Member
              • Nov 2008
              • 26

              #7
              Originally posted by QVeen72
              Hi,

              On your Form, Double Click the TreeView, and from event's list, Select the NodeClick event..
              From my code, change the name of Control Treeview , Give your control name accordingly..

              Regards
              Veena

              Thanks you so much... it works...

              How to put image on the treeview??/
              how to initialize

              God bless

              Comment

              • QVeen72
                Recognized Expert Top Contributor
                • Oct 2006
                • 1445

                #8
                Hi,

                Add an ImageList Control to your Form.
                Add All the Images,
                Select Treeview's Property : ImageList = ImageList1
                Now when you add nodes, To Set 4th Image in Image List :
                Give this syntax:

                TrVw.Nodes.Add , , "MynewNode" , "New Node", 4

                Change Images's Index Accordingly..

                Regards
                Veena

                Comment

                • nurikoAnna
                  New Member
                  • Nov 2008
                  • 26

                  #9
                  Originally posted by QVeen72
                  Hi,

                  Add an ImageList Control to your Form.
                  Add All the Images,
                  Select Treeview's Property : ImageList = ImageList1
                  Now when you add nodes, To Set 4th Image in Image List :
                  Give this syntax:

                  TrVw.Nodes.Add , , "MynewNode" , "New Node", 4

                  Change Images's Index Accordingly..

                  Regards
                  Veena


                  Thanks God bless....

                  Comment

                  • nurikoAnna
                    New Member
                    • Nov 2008
                    • 26

                    #10
                    Originally posted by debasisdas
                    Are you fetching any data from database and want to display on a form ?

                    or you want to open a new form each time you click on a new node ?


                    what if I am fetching data freom the databse??/ can you help me with that???

                    Comment

                    Working...