| {\rtf1\ansi\ansicpg1252\deff0\deflang1044{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}} \viewkind4\uc1\pard\f0\fs17 This code will copy one TreeView's nodes to another. To use this code copy and paste it into a form or module. To copy a TreeView use this \par \par copyTreeView TreeView1, TreeView2 \par \par Sub copyTreeView(Tview1 As TreeView, Tview2 As TreeView) \par Dim Nodx As Node \par With Tview2 \par .Nodes.Clear \par Set .ImageList = Tview1.ImageList \par For Each Nodx In Tview1.Nodes \par If Nodx.Parent Is Nothing Then \par .Nodes.Add , , Nodx.Key, Nodx.Text, Nodx.Image, Nodx.SelectedImage \par Else \par .Nodes.Add Nodx.Parent.Key, tvwChild, Nodx.Key, Nodx.Text, Nodx.Image, Nodx.SelectedImage \par End If \par Next \par End With \par End Sub \par } |
Copying a TreeView Control |
India web developer web development India | India web development company India ecommerce web developer