Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Visual Basic 2010 Programmer's Reference
This is the forum to discuss the Wrox book Visual Basic 2010 Programmer's Reference by Rod Stephens; ISBN: 9780470499832
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2010 Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 24th, 2012, 11:53 AM
Authorized User
Points: 193, Level: 3
Points: 193, Level: 3 Points: 193, Level: 3 Points: 193, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Posts: 31
Thanks: 6
Thanked 0 Times in 0 Posts
Question TreeNodes

Hi Rod,

I am making an application which will allow the end user to generate a list in Tree view. The code I included is for each of the two click events. One Click Event creates the first level node and the other creates a second level node. The code below works well, but I would like to also create a third level Node. Is it possible to do so? And if so, can you show me how?

Thank you for your help.

Sincerely,

Gary Tanis


Code:
Public Class Form1

    Private Sub DocumentIndex_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLevelOne.Click

        Dim NewNodes As String
        NewNodes = TextBox1.Text
        TreeView1.Nodes.Add(NewNodes)

    End Sub



    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLevelTwo.Click

        Dim ChildNode As String
        ChildNode = TextBox2.Text

        Dim objNode As TreeNode
        objNode = TreeView1.SelectedNode()

        TreeView1.Nodes.Remove(TreeView1.SelectedNode)
        TreeView1.Nodes.Add(objNode)
        objNode.Nodes.Add(ChildNode)



    End Sub
Reply With Quote
  #2 (permalink)  
Old March 5th, 2012, 03:28 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,166, Level: 23
Points: 3,166, Level: 23 Points: 3,166, Level: 23 Points: 3,166, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Sorry for the delay. See the related thread for a reply.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
expansion and collapse of treenodes in jsp page pavankumar_tatiraju Javascript 0 February 12th, 2007 02:56 AM



All times are GMT -4. The time now is 03:03 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.