Click here to Skip to main content
15,887,135 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: class structure Pin
Luc Pattyn10-Mar-09 8:55
sitebuilderLuc Pattyn10-Mar-09 8:55 
Questionproblem in printing Pin
Jagz W10-Mar-09 7:11
professionalJagz W10-Mar-09 7:11 
AnswerRe: problem in printing Pin
Dave Kreskowiak11-Mar-09 2:50
mveDave Kreskowiak11-Mar-09 2:50 
QuestionProgress bar and FTP server Pin
Farid_Bilal10-Mar-09 6:33
Farid_Bilal10-Mar-09 6:33 
AnswerRe: Progress bar and FTP server Pin
0x3c010-Mar-09 6:55
0x3c010-Mar-09 6:55 
QuestionTreeview duplicating nodes Pin
garfield18510-Mar-09 4:45
garfield18510-Mar-09 4:45 
AnswerRe: Treeview duplicating nodes Pin
Jon_Boy10-Mar-09 9:07
Jon_Boy10-Mar-09 9:07 
GeneralRe: Treeview duplicating nodes Pin
garfield18510-Mar-09 21:59
garfield18510-Mar-09 21:59 
I'm sorry!! Here is the code.

I just created a Windows VB.NET application, and put on it a treeview named TreeView1 and a button named Button1. Also, insert some random nodes on the treeview, doesn't matter, because all will appear duplicated.

The recursive function is Recorre, as you can see, this function will read all the nodes on the treeview, but won't write anything on it, so, it is so weird for me when I get all the data duplicated.




Imports System.Windows.Forms

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TreeView1.ExpandAll()
End Sub

Private Sub Recorre(ByRef Nodo As TreeNode)
Dim i As Integer
For i = 0 To Nodo.Nodes.Count - 1
Recorre(Nodo.Nodes(i))
Next
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
Dim TreeView2 As TreeView
TreeView1.BeginUpdate()
For i = 0 To TreeView1.Nodes.Count - 1
Recorre(TreeView1.Nodes(i))
Next
TreeView2 = New TreeView
TreeView2 = TreeView1
Me.Controls.Remove(TreeView1)
TreeView1 = Nothing
TreeView1 = New TreeView
Me.Controls.Add(TreeView1)
TreeView1.Width = 176
TreeView1.Height = 242
TreeView1.Top = 12
TreeView1.Left = 12
TreeView1.CheckBoxes = True
TreeView1.Refresh()
TreeView1.EndUpdate()


TreeView1 = TreeView2


End Sub
End Class

Time to come clean...

Vive y deja vivir / Live and let live

Javier

GeneralRe: Treeview duplicating nodes Pin
Jon_Boy11-Mar-09 3:36
Jon_Boy11-Mar-09 3:36 
GeneralRe: Treeview duplicating nodes Pin
garfield18511-Mar-09 3:56
garfield18511-Mar-09 3:56 
QuestionDelete from Mutiple listboxes at the same time Pin
Ebrima Sawaneh10-Mar-09 2:08
Ebrima Sawaneh10-Mar-09 2:08 
AnswerRe: Delete from Mutiple listboxes at the same time Pin
Jon_Boy10-Mar-09 9:13
Jon_Boy10-Mar-09 9:13 
Questionresizing flash sockwave object in vb.net Pin
hrishiS10-Mar-09 1:25
hrishiS10-Mar-09 1:25 
Questionvb.net set up Pin
hrishiS10-Mar-09 1:22
hrishiS10-Mar-09 1:22 
AnswerRe: vb.net set up Pin
Johan Hakkesteegt11-Mar-09 8:00
Johan Hakkesteegt11-Mar-09 8:00 
QuestionResizing Windows Forms Pin
briogene10-Mar-09 0:24
briogene10-Mar-09 0:24 
AnswerRe: Resizing Windows Forms Pin
Dave Kreskowiak10-Mar-09 7:48
mveDave Kreskowiak10-Mar-09 7:48 
Questionmerge module for crystal report [modified] Pin
hrishiS10-Mar-09 0:21
hrishiS10-Mar-09 0:21 
QuestionSetup in vb.net Pin
mahalakshmi4210-Mar-09 0:17
mahalakshmi4210-Mar-09 0:17 
AnswerRe: Setup in vb.net Pin
briogene10-Mar-09 0:28
briogene10-Mar-09 0:28 
QuestionUser Control Sub Properties. Pin
Nanda_MR9-Mar-09 23:39
Nanda_MR9-Mar-09 23:39 
AnswerRe: User Control Sub Properties. Pin
Dave Kreskowiak10-Mar-09 7:40
mveDave Kreskowiak10-Mar-09 7:40 
QuestionIncrement using Database Pin
nazimghori9-Mar-09 23:31
nazimghori9-Mar-09 23:31 
GeneralRe: Increment using Database Pin
Luc Pattyn10-Mar-09 0:58
sitebuilderLuc Pattyn10-Mar-09 0:58 
AnswerRe: Increment using Database Pin
Jon_Boy10-Mar-09 2:19
Jon_Boy10-Mar-09 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.