vb6.0 关闭窗体,打开窗体。

3个窗体,第一个有2个按钮1和2。
点1时显示窗体2,关闭窗体1.关闭2时显示窗体1.
点2时,显示窗体3,关闭窗体1.关闭3时显示窗体1.
写点代码吧

'Form1代码
Private Sub Command1_Click()
Form2.Show
Me.Hide
End Sub

Private Sub Command2_Click()
Form3.Show
Me.Hide
End Sub

'Form2代码
Private Sub Form_Unload(Cancel As Integer)
Form1.Show
End Sub

'Form3代码
Private Sub Form_Unload(Cancel As Integer)
Form1.Show
End Sub
温馨提示:答案为网友推荐,仅供参考
第1个回答  2011-08-19
窗体一代码:
Private Sub Command1_Click()
Form2.Show
Unload Me
End Sub
Private Sub Command2_Click()
Form3.Show
Unload Me
End Sub
Private Sub Form_Load()
Command1.Caption = "窗体2"
Command2.Caption = "窗体3"
End Sub
窗体二和窗体三代码都是:
Private Sub Form_Unload(Cancel As Integer)
Form1.Show
End Sub
第2个回答  2011-08-19
'Form1
Private Sub Command1_Click()
Form2.Show
Form1.Hide
End Sub

Private Sub Command2_Click()
Form3.Show
Form1.Hide
End Sub

'Form2
Private Sub Form_Unload(Cancel As Integer)
Form1.Show
End Sub

'Form3
Private Sub Form_Unload(Cancel As Integer)
Form1.Show
End Sub