是否可以打开sub传递的表单作为新表单,例如: vb.net 2010 windows窗体
Public Sub CheckMembership (byVal OpenFormName as form)
Using NewFormInstance as new OpenFormName
NewFormInstance.ShowDialog
End Using
End Sub
答案 0 :(得分:1)
您无需创建传递给此方法的表单的新实例。你可以这样做:
Public Sub CheckMembership (byVal OpenFormName as form)
OpenFormName.ShowDialog
End Sub
如果您想每次都打开一个新表单,您的方法中不需要参数。你可以这样做:
Public Sub CheckMembership()
Dim OpenFormName As New YourFormClass
OpenFormName.ShowDialog()
End Sub
答案 1 :(得分:0)
Public Sub CheckMembership (byval OpenFormName as form)
OpenFormName.ShowDialog
End Sub