因为这种形式很容易使用,新的和处理,它不适用于打断奶的形式。只有在这个相同的地方。您可以使用互斥体或此模块属性的某个单例即时,或其他通知方法,告知此模块已创建以及何时释放。
Sub New()
' This call is required by the designer.
InitializeComponent()
If Not co Is Nothing Then Throw New Exception
co = Me ' assign public propert in module or singleton
' Add any initialization after the InitializeComponent() call.
End Sub
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
co = Nothing
MyBase.Dispose(disposing)
End Try
End Sub
Module common
Property co As UserControl1
结束模块