Visual Basic NET ( 3)




TreeView - 4


Dim As TreeNode

For Each In TV.Nodes

.Remove()

Next

End Sub

Private Sub __Click(ByVal sender As Object, ByVal e As EventArgs) Handles _.Click

Dim As New TreeNode(TextBox1.Text)

If TV.GetNodeCount(True) = 0 Then

TV.Nodes.Add()

TV.Focus()

ElseIf TV.SelectedNode Is Nothing Then

MsgBox(" ")

Else

TV.SelectedNode.Nodes.Add()

.Parent.Expand()

End If

End Sub

Private Sub __Click(ByVal sender As Object, ByVal e As EventArgs) Handles _.Click

Dim As New TreeNode(TextBox1.Text)

If TV.GetNodeCount(True) = 0 Then

TV.Nodes.Add()

TV.Focus()

ElseIf TV.SelectedNode Is Nothing Then

MsgBox(" ")

ElseIf TV.SelectedNode.Parent Is Nothing Then

TV.Nodes.Add()

Else

TV.SelectedNode.Parent.Nodes.Add()

End If

End Sub

Private Sub _Click(ByVal sender As Object, ByVal e As EventArgs) Handles .Click

If TV.GetNodeCount(True) = 0 Then

MsgBox(" ")

ElseIf TV.SelectedNode Is Nothing Then

MsgBox(" ")

Else

TV.SelectedNode.Text = TextBox1.Text

End If

End Sub

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

If TV.GetNodeCount(True) = 0 Or TV.SelectedNode Is Nothing Then Exit Sub

TV.SelectedNode.Remove()

End Sub

: Form1_Load , . Remove , , TV.Nodes, .