|
-
February 25th, 2003, 09:40 PM
#1
Switch between froms.
Hi~~
try to switch between different forms in my code, but how do I close my first form once I open the second form?
the following is my code, can anyone tell me where I did wrong?
Private Sub btnForm2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnForm2.Click
Dim frmForm2 As New frmForm2()
Dim frmForm1 As New frmForm1()
frmForm2.Show()
frmForm1.Hide()
End Sub
Thank you for your help .
-
February 27th, 2003, 02:53 PM
#2
You may want to use the Close function for forms. This seems to work.
-
February 27th, 2003, 03:19 PM
#3
You can use Load to load a form into memory and Unload to unload it... Show to show a form (if it is not load, it loads), and Hide to hide it (but still in memory unless using unload).
You cannot use the code above, because you are creating a new instance for frmForm1 and frmForm2.
Try just with
Private Sub Command1_Click()
Form2.Show
Form3.Hide
End Sub
Private Sub Command2_Click()
Form3.Show
Form2.Hide
End Sub
Caronte
Si tiene solución... ¿por qué te preocupas?
Si no tiene solución... ¿por qué te preocupas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|