Public Class Form1
Private f As Form
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
Dim node As TreeNode = TreeView1.SelectedNode
Select Case node.Text
Case "General"
'general.TextBox1.Enabled = False
f.Dispose()
f = New general()
f.TopLevel = False
Me.Panel1.Controls.Add(f)
f.Dock = DockStyle.Fill
f.Show()
Case "Factura electrónica"
f.Dispose()
f = New fa()
f.TopLevel = False
Me.Panel1.Controls.Add(f)
f.Dock = DockStyle.Fill
f.Show()
Case "Nota de credito"
f.Dispose()
f = New nc()
f.TopLevel = False
Me.Panel1.Controls.Add(f)
f.Dock = DockStyle.Fill
f.Show()
End Select
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TreeView1.HideSelection = True
TreeView1.TabIndex = 0
f = New general()
f.TopLevel = False
Me.Panel1.Controls.Add(f)
f.Dock = DockStyle.Fill
f.Show()
End Sub
End Class
No hay comentarios.:
Publicar un comentario