Private m_Form2 As Form2
Private Sub Form2MenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Form2MenuItem.Click
If m_Form2 Is Nothing OrElse m_Form2.IsDisposed Then
m_Form2 = New Form2
m_Form2.MdiParent = Me
m_Form2.Show()
Else
m_Form2.Activate()
End If
End Sub
注:以前我是运用通过记录Handle来遍历子窗体的办法.今天看着Dispose,试试能不能利用,果是行的.
不知这样做法有什么弊处.