无法访问已释放的对象
Imports System.Windows.Forms
Public Class Form1
Dim sform As New Form2
Dim ssform As New Form3
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
If TreeView1.SelectedNode.Text = "1" Then
sform.MdiParent = Me
sform.LayoutMdi(MdiLayout.Cascade)
sform.Show()
ElseIf TreeView1.SelectedNode.Text = "2" Then
ssform.MdiParent = Me
ssform.LayoutMdi(MdiLayout.Cascade)
ssform.Show()
Else : MsgBox("as")
End If
End Sub