我变了一个程序目的想在主窗口单击按钮调用子窗口在子窗口单击按钮返回主窗口
下面是我的程序
主窗口
Public Class main
Inherits System.Windows.Forms.Form
Dim beng1cs As New beng1cs()
windows窗体生成器代码
Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
Close()
End Sub
Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bengPictureBox2.Click
End Sub
Private Sub bengPictureBox1_dblClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bengPictureBox1.Click
beng1cs.Show()
Me.Close()
End Sub
End Class
子窗体代码
Public Class beng1cs
Inherits System.Windows.Forms.Form
Dim mian As New main()
" Windows 窗体设计器生成的代码 "
Private Sub beng1fh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles beng1fh.Click
mian.Show()
Me.Close()
End Sub
End Class
可是编译后出现了这个对话框
谁知道是怎么回事谢谢