<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2FGUI%2FTreeView</id>
		<title>VB.Net Tutorial/GUI/TreeView - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VB.Net_Tutorial%2FGUI%2FTreeView"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/GUI/TreeView&amp;action=history"/>
		<updated>2026-04-05T20:59:45Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/GUI/TreeView&amp;diff=3792&amp;oldid=prev</id>
		<title> в 16:40, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/GUI/TreeView&amp;diff=3792&amp;oldid=prev"/>
				<updated>2010-05-26T16:40:30Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 16:40, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VB.Net_Tutorial/GUI/TreeView&amp;diff=3793&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VB.Net_Tutorial/GUI/TreeView&amp;diff=3793&amp;oldid=prev"/>
				<updated>2010-05-26T12:56:45Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Add and remove tree nodes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Windows.Forms&lt;br /&gt;
public class TreeViewAddDeleteItem&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    Friend WithEvents TreeView1 As System.Windows.Forms.TreeView&lt;br /&gt;
    Friend WithEvents Button1 As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents Button2 As System.Windows.Forms.Button&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.TreeView1 = New System.Windows.Forms.TreeView&lt;br /&gt;
        Me.Button1 = New System.Windows.Forms.Button&lt;br /&gt;
        Me.Button2 = New System.Windows.Forms.Button&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;TreeView1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.TreeView1.ImageIndex = -1&lt;br /&gt;
        Me.TreeView1.Location = New System.Drawing.Point(48, 16)&lt;br /&gt;
        Me.TreeView1.Name = &amp;quot;TreeView1&amp;quot;&lt;br /&gt;
        Me.TreeView1.Nodes.AddRange(New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode(&amp;quot;a&amp;quot;, New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode(&amp;quot;Visual Basic&amp;quot;), New System.Windows.Forms.TreeNode(&amp;quot;Visual C++&amp;quot;), New System.Windows.Forms.TreeNode(&amp;quot;Delphi&amp;quot;), New System.Windows.Forms.TreeNode(&amp;quot;Java&amp;quot;)}), New System.Windows.Forms.TreeNode(&amp;quot;B&amp;quot;, New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode(&amp;quot;B1&amp;quot;), New System.Windows.Forms.TreeNode(&amp;quot;B2&amp;quot;), New System.Windows.Forms.TreeNode(&amp;quot;B3&amp;quot;), New System.Windows.Forms.TreeNode(&amp;quot;B4&amp;quot;)})})&lt;br /&gt;
        Me.TreeView1.SelectedImageIndex = -1&lt;br /&gt;
        Me.TreeView1.Size = New System.Drawing.Size(200, 168)&lt;br /&gt;
        Me.TreeView1.TabIndex = 0&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Button1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Button1.Location = New System.Drawing.Point(48, 200)&lt;br /&gt;
        Me.Button1.Name = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        Me.Button1.Size = New System.Drawing.Size(80, 24)&lt;br /&gt;
        Me.Button1.TabIndex = 1&lt;br /&gt;
        Me.Button1.Text = &amp;quot;Add&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Button2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Button2.Location = New System.Drawing.Point(176, 200)&lt;br /&gt;
        Me.Button2.Name = &amp;quot;Button2&amp;quot;&lt;br /&gt;
        Me.Button2.Size = New System.Drawing.Size(80, 24)&lt;br /&gt;
        Me.Button2.TabIndex = 2&lt;br /&gt;
        Me.Button2.Text = &amp;quot;Delete&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(292, 238)&lt;br /&gt;
        Me.Controls.Add(Me.Button2)&lt;br /&gt;
        Me.Controls.Add(Me.Button1)&lt;br /&gt;
        Me.Controls.Add(Me.TreeView1)&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;
        Dim str As New TreeNode&lt;br /&gt;
        TreeView1.SelectedNode.Nodes.Add(&amp;quot;New&amp;quot;)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click&lt;br /&gt;
        TreeView1.Nodes.Remove(TreeView1.SelectedNode)&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Build file tree recursively==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class BuildFileTree&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Private Sub ActTraverse_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles ActTraverse.Click&lt;br /&gt;
        If (My.ruputer.FileSystem.DirectoryExists(StartPath.Text) = False) Then&lt;br /&gt;
            Exit Sub&lt;br /&gt;
        End If&lt;br /&gt;
        PathTree.Nodes.Clear()&lt;br /&gt;
        BuildDirectoryTree(Nothing, StartPath.Text)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub BuildDirectoryTree(ByVal fromNode As TreeNode,ByVal basePath As String)&lt;br /&gt;
        Dim newDirectory As TreeNode&lt;br /&gt;
        Dim justTheSubdirectory As String&lt;br /&gt;
        For Each oneDirectory As String In My.ruputer.FileSystem.GetDirectories(basePath)&lt;br /&gt;
            justTheSubdirectory = My.ruputer.FileSystem.GetName(oneDirectory)&lt;br /&gt;
            If (fromNode Is Nothing) Then&lt;br /&gt;
                newDirectory = PathTree.Nodes.Add( justTheSubdirectory)&lt;br /&gt;
            Else&lt;br /&gt;
                newDirectory = fromNode.Nodes.Add(justTheSubdirectory)&lt;br /&gt;
            End If&lt;br /&gt;
            BuildDirectoryTree(newDirectory, My.ruputer.FileSystem.rubinePath(basePath, justTheSubdirectory))&lt;br /&gt;
        Next oneDirectory&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Global.Microsoft.VisualBasic.rupilerServices.DesignerGenerated()&amp;gt; _&lt;br /&gt;
Partial Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerNonUserCode()&amp;gt; _&lt;br /&gt;
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing AndAlso components IsNot Nothing Then&lt;br /&gt;
            components.Dispose()&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; _&lt;br /&gt;
    Private Sub InitializeComponent()&lt;br /&gt;
        Me.ActTraverse = New System.Windows.Forms.Button&lt;br /&gt;
        Me.StartPath = New System.Windows.Forms.TextBox&lt;br /&gt;
        Me.PathTree = New System.Windows.Forms.TreeView&lt;br /&gt;
        Me.Label1 = New System.Windows.Forms.Label&lt;br /&gt;
        Me.Label2 = New System.Windows.Forms.Label&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;ActTraverse&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.ActTraverse.Location = New System.Drawing.Point(326, 32)&lt;br /&gt;
        Me.ActTraverse.Name = &amp;quot;ActTraverse&amp;quot;&lt;br /&gt;
        Me.ActTraverse.Size = New System.Drawing.Size(75, 23)&lt;br /&gt;
        Me.ActTraverse.TabIndex = 2&lt;br /&gt;
        Me.ActTraverse.Text = &amp;quot;Traverse&amp;quot;&lt;br /&gt;
        Me.ActTraverse.UseVisualStyleBackColor = True&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;StartPath&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.StartPath.Location = New System.Drawing.Point(72, 8)&lt;br /&gt;
        Me.StartPath.Name = &amp;quot;StartPath&amp;quot;&lt;br /&gt;
        Me.StartPath.Size = New System.Drawing.Size(328, 20)&lt;br /&gt;
        Me.StartPath.TabIndex = 1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;PathTree&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.PathTree.Location = New System.Drawing.Point(72, 64)&lt;br /&gt;
        Me.PathTree.Name = &amp;quot;PathTree&amp;quot;&lt;br /&gt;
        Me.PathTree.Size = New System.Drawing.Size(329, 184)&lt;br /&gt;
        Me.PathTree.TabIndex = 4&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Label1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label1.AutoSize = True&lt;br /&gt;
        Me.Label1.Location = New System.Drawing.Point(8, 10)&lt;br /&gt;
        Me.Label1.Name = &amp;quot;Label1&amp;quot;&lt;br /&gt;
        Me.Label1.Size = New System.Drawing.Size(57, 13)&lt;br /&gt;
        Me.Label1.TabIndex = 0&lt;br /&gt;
        Me.Label1.Text = &amp;quot;Start Path:&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Label2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label2.AutoSize = True&lt;br /&gt;
        Me.Label2.Location = New System.Drawing.Point(8, 66)&lt;br /&gt;
        Me.Label2.Name = &amp;quot;Label2&amp;quot;&lt;br /&gt;
        Me.Label2.Size = New System.Drawing.Size(57, 13)&lt;br /&gt;
        Me.Label2.TabIndex = 3&lt;br /&gt;
        Me.Label2.Text = &amp;quot;Path Tree:&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)&lt;br /&gt;
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(411, 260)&lt;br /&gt;
        Me.Controls.Add(Me.Label2)&lt;br /&gt;
        Me.Controls.Add(Me.Label1)&lt;br /&gt;
        Me.Controls.Add(Me.PathTree)&lt;br /&gt;
        Me.Controls.Add(Me.StartPath)&lt;br /&gt;
        Me.Controls.Add(Me.ActTraverse)&lt;br /&gt;
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle&lt;br /&gt;
        Me.MaximizeBox = False&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Directory Traversal&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
        Me.PerformLayout()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Friend WithEvents ActTraverse As System.Windows.Forms.Button&lt;br /&gt;
    Friend WithEvents StartPath As System.Windows.Forms.TextBox&lt;br /&gt;
    Friend WithEvents PathTree As System.Windows.Forms.TreeView&lt;br /&gt;
    Friend WithEvents Label1 As System.Windows.Forms.Label&lt;br /&gt;
    Friend WithEvents Label2 As System.Windows.Forms.Label&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Creating Tree Views in Code==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class TreeViewCreationInCode&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    Dim TreeView1 As TreeView&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(292, 293)&lt;br /&gt;
        TreeView1 = New TreeView&lt;br /&gt;
        TreeView1.Location = New Point(75, 100)&lt;br /&gt;
        TreeView1.Size = New Size(150, 150)&lt;br /&gt;
        Controls.Add(TreeView1)&lt;br /&gt;
        TreeView1.Nodes.Clear()&lt;br /&gt;
        Dim RootNode = New TreeNode(&amp;quot;Root&amp;quot;)&lt;br /&gt;
        TreeView1.Nodes.Add(RootNode)&lt;br /&gt;
        TreeView1.Nodes(0).Nodes.Add(New TreeNode(&amp;quot;Node 1&amp;quot;))&lt;br /&gt;
        For intLoopIndex As Integer = 2 To 3&lt;br /&gt;
            TreeView1.Nodes(0).Nodes(0).Nodes.Add(New _&lt;br /&gt;
                TreeNode(&amp;quot;Node&amp;quot; &amp;amp; Str(intLoopIndex)))&lt;br /&gt;
        Next intLoopIndex&lt;br /&gt;
        TreeView1.Nodes(0).Nodes.Add(New TreeNode(&amp;quot;Node 4&amp;quot;))&lt;br /&gt;
        For intLoopIndex As Integer = 5 To 6&lt;br /&gt;
            TreeView1.Nodes(0).Nodes(1).Nodes.Add(New _&lt;br /&gt;
                TreeNode(&amp;quot;Node&amp;quot; &amp;amp; Str(intLoopIndex)))&lt;br /&gt;
        Next intLoopIndex&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Tree Node selection event==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Windows.Forms&lt;br /&gt;
public class SplitterControl&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
    End Sub&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    Friend WithEvents Splitter1 As System.Windows.Forms.Splitter&lt;br /&gt;
    Friend WithEvents TreeView1 As System.Windows.Forms.TreeView&lt;br /&gt;
    Friend WithEvents ImageList1 As System.Windows.Forms.ImageList&lt;br /&gt;
    Friend WithEvents Splitter2 As System.Windows.Forms.Splitter&lt;br /&gt;
    Friend WithEvents Panel1 As System.Windows.Forms.Panel&lt;br /&gt;
    Friend WithEvents Label1 As System.Windows.Forms.Label&lt;br /&gt;
    Friend WithEvents Splitter3 As System.Windows.Forms.Splitter&lt;br /&gt;
    Friend WithEvents ListView1 As System.Windows.Forms.ListView&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.ruponents = New System.ruponentModel.Container&lt;br /&gt;
        Me.Splitter1 = New System.Windows.Forms.Splitter&lt;br /&gt;
        Me.TreeView1 = New System.Windows.Forms.TreeView&lt;br /&gt;
        Me.ImageList1 = New System.Windows.Forms.ImageList(Me.ruponents)&lt;br /&gt;
        Me.Splitter2 = New System.Windows.Forms.Splitter&lt;br /&gt;
        Me.Panel1 = New System.Windows.Forms.Panel&lt;br /&gt;
        Me.Label1 = New System.Windows.Forms.Label&lt;br /&gt;
        Me.Splitter3 = New System.Windows.Forms.Splitter&lt;br /&gt;
        Me.ListView1 = New System.Windows.Forms.ListView&lt;br /&gt;
        Me.Panel1.SuspendLayout()&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Splitter1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Splitter1.Location = New System.Drawing.Point(0, 0)&lt;br /&gt;
        Me.Splitter1.Name = &amp;quot;Splitter1&amp;quot;&lt;br /&gt;
        Me.Splitter1.Size = New System.Drawing.Size(3, 266)&lt;br /&gt;
        Me.Splitter1.TabIndex = 0&lt;br /&gt;
        Me.Splitter1.TabStop = False&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;TreeView1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.TreeView1.Dock = System.Windows.Forms.DockStyle.Left&lt;br /&gt;
        Me.TreeView1.Location = New System.Drawing.Point(3, 0)&lt;br /&gt;
        Me.TreeView1.Name = &amp;quot;TreeView1&amp;quot;&lt;br /&gt;
        Me.TreeView1.Nodes.AddRange(New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode(&amp;quot;A&amp;quot;, New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode(&amp;quot;Visual Basic&amp;quot;), New System.Windows.Forms.TreeNode(&amp;quot;Visual C++&amp;quot;), New System.Windows.Forms.TreeNode(&amp;quot;Delphi&amp;quot;), New System.Windows.Forms.TreeNode(&amp;quot;Java&amp;quot;)}), New System.Windows.Forms.TreeNode(&amp;quot;B&amp;quot;, New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode(&amp;quot;1&amp;quot;), New System.Windows.Forms.TreeNode(&amp;quot;2&amp;quot;), New System.Windows.Forms.TreeNode(&amp;quot;3&amp;quot;), New System.Windows.Forms.TreeNode(&amp;quot;4&amp;quot;)})})&lt;br /&gt;
        Me.TreeView1.Size = New System.Drawing.Size(101, 266)&lt;br /&gt;
        Me.TreeView1.TabIndex = 1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Splitter2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Splitter2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D&lt;br /&gt;
        Me.Splitter2.Location = New System.Drawing.Point(104, 0)&lt;br /&gt;
        Me.Splitter2.Name = &amp;quot;Splitter2&amp;quot;&lt;br /&gt;
        Me.Splitter2.Size = New System.Drawing.Size(8, 266)&lt;br /&gt;
        Me.Splitter2.TabIndex = 2&lt;br /&gt;
        Me.Splitter2.TabStop = False&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Panel1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D&lt;br /&gt;
        Me.Panel1.Controls.Add(Me.ListView1)&lt;br /&gt;
        Me.Panel1.Controls.Add(Me.Splitter3)&lt;br /&gt;
        Me.Panel1.Controls.Add(Me.Label1)&lt;br /&gt;
        Me.Panel1.Dock = System.Windows.Forms.DockStyle.Top&lt;br /&gt;
        Me.Panel1.Location = New System.Drawing.Point(112, 0)&lt;br /&gt;
        Me.Panel1.Name = &amp;quot;Panel1&amp;quot;&lt;br /&gt;
        Me.Panel1.Size = New System.Drawing.Size(248, 264)&lt;br /&gt;
        Me.Panel1.TabIndex = 3&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Label1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Label1.Dock = System.Windows.Forms.DockStyle.Top&lt;br /&gt;
        Me.Label1.Location = New System.Drawing.Point(0, 0)&lt;br /&gt;
        Me.Label1.Name = &amp;quot;Label1&amp;quot;&lt;br /&gt;
        Me.Label1.Size = New System.Drawing.Size(244, 32)&lt;br /&gt;
        Me.Label1.TabIndex = 0&lt;br /&gt;
        Me.Label1.Text = &amp;quot;Label1&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Splitter3&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Splitter3.Dock = System.Windows.Forms.DockStyle.Top&lt;br /&gt;
        Me.Splitter3.Location = New System.Drawing.Point(0, 32)&lt;br /&gt;
        Me.Splitter3.Name = &amp;quot;Splitter3&amp;quot;&lt;br /&gt;
        Me.Splitter3.Size = New System.Drawing.Size(244, 8)&lt;br /&gt;
        Me.Splitter3.TabIndex = 1&lt;br /&gt;
        Me.Splitter3.TabStop = False&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;ListView1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.ListView1.Dock = System.Windows.Forms.DockStyle.Fill&lt;br /&gt;
        Me.ListView1.Location = New System.Drawing.Point(0, 40)&lt;br /&gt;
        Me.ListView1.Name = &amp;quot;ListView1&amp;quot;&lt;br /&gt;
        Me.ListView1.Size = New System.Drawing.Size(244, 220)&lt;br /&gt;
        Me.ListView1.TabIndex = 2&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(360, 266)&lt;br /&gt;
        Me.Controls.Add(Me.Panel1)&lt;br /&gt;
        Me.Controls.Add(Me.Splitter2)&lt;br /&gt;
        Me.Controls.Add(Me.TreeView1)&lt;br /&gt;
        Me.Controls.Add(Me.Splitter1)&lt;br /&gt;
        Me.Panel1.ResumeLayout(False)&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect&lt;br /&gt;
        Dim childnum, index, i As Int32&lt;br /&gt;
        childnum = TreeView1.SelectedNode.GetNodeCount(False)&lt;br /&gt;
        index = TreeView1.SelectedNode.Index&lt;br /&gt;
        index = index + 1&lt;br /&gt;
        ListView1.Items.Clear()&lt;br /&gt;
        For i = 0 To childnum - 1&lt;br /&gt;
            ListView1.Items.Add(index.ToString + &amp;quot;.&amp;quot; + i.ToString, 1)&lt;br /&gt;
        Next&lt;br /&gt;
        Label1.Text = TreeView1.SelectedNode.FullPath&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==TreeView CheckBox==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.Drawing&lt;br /&gt;
Imports System.Drawing.Drawing2D&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class TreeViewSelectionCheckBoxes&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New Form1)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
Public Class Form1&lt;br /&gt;
    Inherits System.Windows.Forms.Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
    Public Sub New()&lt;br /&gt;
        MyBase.New()&lt;br /&gt;
        &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
        InitializeComponent()&lt;br /&gt;
        &amp;quot;Add any initialization after the InitializeComponent() call&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
        If disposing Then&lt;br /&gt;
            If Not (components Is Nothing) Then&lt;br /&gt;
                components.Dispose()&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
        MyBase.Dispose(disposing)&lt;br /&gt;
    End Sub&lt;br /&gt;
    &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
    Private components As System.ruponentModel.IContainer&lt;br /&gt;
    &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
    &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
    &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
    Friend WithEvents TreeView1 As System.Windows.Forms.TreeView&lt;br /&gt;
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox&lt;br /&gt;
    Friend WithEvents Button1 As System.Windows.Forms.Button&lt;br /&gt;
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
        Me.TreeView1 = New System.Windows.Forms.TreeView&lt;br /&gt;
        Me.TextBox1 = New System.Windows.Forms.TextBox&lt;br /&gt;
        Me.Button1 = New System.Windows.Forms.Button&lt;br /&gt;
        Me.SuspendLayout()&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;TreeView1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.TreeView1.ImageIndex = -1&lt;br /&gt;
        Me.TreeView1.Location = New System.Drawing.Point(88, 64)&lt;br /&gt;
        Me.TreeView1.Name = &amp;quot;TreeView1&amp;quot;&lt;br /&gt;
        Me.TreeView1.Nodes.AddRange(New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode(&amp;quot;Root&amp;quot;, New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode(&amp;quot;Node 1&amp;quot;, New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode(&amp;quot;Node 2&amp;quot;), New System.Windows.Forms.TreeNode(&amp;quot;Node 3&amp;quot;)}), New System.Windows.Forms.TreeNode(&amp;quot;Node 4&amp;quot;, New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode(&amp;quot;Node 5&amp;quot;), New System.Windows.Forms.TreeNode(&amp;quot;Node 6&amp;quot;)})})})&lt;br /&gt;
        Me.TreeView1.SelectedImageIndex = -1&lt;br /&gt;
        Me.TreeView1.Size = New System.Drawing.Size(121, 120)&lt;br /&gt;
        Me.TreeView1.TabIndex = 0&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;TextBox1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.TextBox1.Location = New System.Drawing.Point(88, 200)&lt;br /&gt;
        Me.TextBox1.Name = &amp;quot;TextBox1&amp;quot;&lt;br /&gt;
        Me.TextBox1.Size = New System.Drawing.Size(120, 20)&lt;br /&gt;
        Me.TextBox1.TabIndex = 1&lt;br /&gt;
        Me.TextBox1.Text = &amp;quot;&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Button1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.Button1.Location = New System.Drawing.Point(88, 232)&lt;br /&gt;
        Me.Button1.Name = &amp;quot;Button1&amp;quot;&lt;br /&gt;
        Me.Button1.Size = New System.Drawing.Size(120, 23)&lt;br /&gt;
        Me.Button1.TabIndex = 3&lt;br /&gt;
        Me.Button1.Text = &amp;quot;Show Check Boxes&amp;quot;&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        &amp;quot;Form1&lt;br /&gt;
        &amp;quot;&lt;br /&gt;
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
        Me.ClientSize = New System.Drawing.Size(292, 273)&lt;br /&gt;
        Me.Controls.Add(Me.Button1)&lt;br /&gt;
        Me.Controls.Add(Me.TextBox1)&lt;br /&gt;
        Me.Controls.Add(Me.TreeView1)&lt;br /&gt;
        Me.Name = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.Text = &amp;quot;Form1&amp;quot;&lt;br /&gt;
        Me.ResumeLayout(False)&lt;br /&gt;
    End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
    Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect&lt;br /&gt;
        TextBox1.Text = e.Node.Text &amp;amp; &amp;quot; was selected.&amp;quot;&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;
        TreeView1.CheckBoxes = True&lt;br /&gt;
    End Sub&lt;br /&gt;
    Private Sub TreeView1_AfterCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterCheck&lt;br /&gt;
        If e.Node.Checked Then&lt;br /&gt;
            TextBox1.Text = e.Node.Text &amp;amp; &amp;quot; is checked.&amp;quot;&lt;br /&gt;
        Else&lt;br /&gt;
            TextBox1.Text = e.Node.Text &amp;amp; &amp;quot; is not checked.&amp;quot;&lt;br /&gt;
        End If&lt;br /&gt;
    End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using a TreeView to display the directory structure==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;vbnet&amp;quot;&amp;gt;Imports System.IO&lt;br /&gt;
Imports System.Windows.Forms&lt;br /&gt;
public class FileTreeView&lt;br /&gt;
   public Shared Sub Main&lt;br /&gt;
        Application.Run(New FrmTreeViewDirectory)&lt;br /&gt;
   End Sub&lt;br /&gt;
End class&lt;br /&gt;
&lt;br /&gt;
Public Class FrmTreeViewDirectory&lt;br /&gt;
   Inherits Form&lt;br /&gt;
#Region &amp;quot; Windows Form Designer generated code &amp;quot;&lt;br /&gt;
   Public Sub New()&lt;br /&gt;
      MyBase.New()&lt;br /&gt;
      &amp;quot;This call is required by the Windows Form Designer.&lt;br /&gt;
      InitializeComponent()&lt;br /&gt;
      &amp;quot;Add any initialization after the InitializeComponent() &lt;br /&gt;
      &amp;quot;call&lt;br /&gt;
   End Sub&lt;br /&gt;
   &amp;quot;Form overrides dispose to clean up the component list.&lt;br /&gt;
   Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;
      If Disposing Then&lt;br /&gt;
         If Not (components Is Nothing) Then&lt;br /&gt;
            components.Dispose()&lt;br /&gt;
         End If&lt;br /&gt;
      End If&lt;br /&gt;
      MyBase.Dispose(Disposing)&lt;br /&gt;
   End Sub&lt;br /&gt;
   &amp;quot; contains view of c: drive directory structure&lt;br /&gt;
   Friend WithEvents treDirectory As System.Windows.Forms.TreeView&lt;br /&gt;
   &amp;quot;Required by the Windows Form Designer&lt;br /&gt;
   Private components As System.ruponentModel.Container&lt;br /&gt;
   &amp;quot;NOTE: The following procedure is required by the Windows Form Designer&lt;br /&gt;
   &amp;quot;It can be modified using the Windows Form Designer.  &lt;br /&gt;
   &amp;quot;Do not modify it using the code editor.&lt;br /&gt;
   &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()&lt;br /&gt;
      Me.treDirectory = New System.Windows.Forms.TreeView()&lt;br /&gt;
      Me.SuspendLayout()&lt;br /&gt;
      &amp;quot;&lt;br /&gt;
      &amp;quot;treDirectory&lt;br /&gt;
      &amp;quot;&lt;br /&gt;
      Me.treDirectory.Dock = System.Windows.Forms.DockStyle.Fill&lt;br /&gt;
      Me.treDirectory.ImageIndex = -1&lt;br /&gt;
      Me.treDirectory.Name = &amp;quot;treDirectory&amp;quot;&lt;br /&gt;
      Me.treDirectory.SelectedImageIndex = -1&lt;br /&gt;
      Me.treDirectory.Size = New System.Drawing.Size(296, 293)&lt;br /&gt;
      Me.treDirectory.TabIndex = 0&lt;br /&gt;
      &amp;quot;&lt;br /&gt;
      &amp;quot;FrmTreeViewDirectory&lt;br /&gt;
      &amp;quot;&lt;br /&gt;
      Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)&lt;br /&gt;
      Me.ClientSize = New System.Drawing.Size(296, 293)&lt;br /&gt;
      Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.treDirectory})&lt;br /&gt;
      Me.Name = &amp;quot;FrmTreeViewDirectory&amp;quot;&lt;br /&gt;
      Me.Text = &amp;quot;TreeViewDirectoryStructure&amp;quot;&lt;br /&gt;
      Me.ResumeLayout(False)&lt;br /&gt;
   End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
   Public Sub PopulateTreeView(ByVal directoryValue As String, _&lt;br /&gt;
      ByVal parentNode As TreeNode)&lt;br /&gt;
      Dim directoryArray As String() = Directory.GetDirectories(directoryValue)&lt;br /&gt;
      If directoryArray.Length &amp;lt;&amp;gt; 0 Then &lt;br /&gt;
         Dim currentDirectory As String&lt;br /&gt;
         For Each currentDirectory In directoryArray&lt;br /&gt;
            Dim myNode As TreeNode = New TreeNode(currentDirectory)&lt;br /&gt;
            parentNode.Nodes.Add(myNode)&lt;br /&gt;
&amp;quot;            PopulateTreeView(currentDirectory, myNode)&lt;br /&gt;
         Next&lt;br /&gt;
      End If&lt;br /&gt;
   End Sub &lt;br /&gt;
   Private Sub FrmTreeViewDirectory_Load(ByVal sender As Object, _&lt;br /&gt;
      ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
      treDirectory.Nodes.Add(&amp;quot;C:&amp;quot;)&lt;br /&gt;
      PopulateTreeView(&amp;quot;C:\&amp;quot;, treDirectory.Nodes(0))&lt;br /&gt;
   End Sub&lt;br /&gt;
End Class&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>