✔ 最佳答案
e.g. 在 Form1 按一個 button 彈一張 Form2 出來
在 Form1 裡
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm2 As New Form2 ' 宣告 frm2 為 Form2 的變數
frm2.Show(Me) ' 現在的 form 是 frm2 的擁有者
Me.Hide() ' 隱藏 Form1
End Sub
在 Form2 裡加入 FormClosing 事件
Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Me.Owner.Show() ' 顯示 Form1
End Sub
2007-05-24 00:49:00 補充:
To chrisyiuThe constructor for form1 should be as follows:Public Sub New(ByVal frm As Form) Me.New() frmparent = frmEnd Sub