0

hi i want to show my 2nd form then close the 1st form. here's that simple codes and i can't do it right. please help

Private Sub btlogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btlogin.Click

    form2.show()
    me.close()

End Sub
2
Contributors
4
Replies
16
Views
5 Years
Discussion Span
Last Post by aarviii
1

What you are doing is:

form2.show() 'showing form2
    me.close()    'closing form1 which is main form. Upon closing it application terminates.

Try following

In coding of form1:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Form2.Show()
End Sub

In coding of form2:

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Form1.Hide()
End Sub
0

thanks for the reply. but from what i ask it is possible?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.