Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

annorying and frustrating problem- please help!!!! 1

Status
Not open for further replies.

ahsan786

Technical User
Feb 4, 2004
12
HK
i have three forms i.e. welcome, login and exit
each of them have buttons,
1. welcome button directs to login form and
2. the login button directs to the exit form and
3. then the exit button exits the program

The 3rd step does not work. the program just exits the exit form and stays in the debug mode. we have to manually press stop debuging to exit the program.
below are the relevant codes for the program. Please help!!!!! THANK YOU IN ADVANCE FOR YOUR TIME AND EXPERTISE

--------------
welcome form
-----------------------
Private Sub WelcomeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WelcomeButton.Click

Dim objLoginForm As New LoginForm
Me.Close()
objLoginForm.Show()

End Sub
---------------------

----------
login form
-----------
Private Sub LoginButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoginButton.Click
Dim objExitForm As New ExitForm
objExitForm.Show()
Me.Close()

End Sub
-------------

------------
exit form
-------------
Private Sub ExitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButton.Click
Dim Form1 As New LoginForm
Dim Form2 As New WelcomeForm
Form1.Close()
Form2.Close()
Me.Close()
End Sub
-----------------------
 
In your exit Sub add 'End' like below.

Private Sub ExitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButton.Click
Dim Form1 As New LoginForm
Dim Form2 As New WelcomeForm
Form1.Close()
Form2.Close()
Me.Close()
'add End here
End
End Sub
 
sorry the original codes are these.............
sorry.............

i have three forms i.e. welcome, login and exit
each of them have buttons,
1. welcome button directs to login form and
2. the login button directs to the exit form and
3. then the exit button exits the program

The 3rd step does not work. the program just exits the exit form and stays in the debug mode. we have to manually press stop debuging to exit the program.
below are the relevant codes for the program. Please help!!!!! THANK YOU IN ADVANCE FOR YOUR TIME AND EXPERTISE

--------------
welcome form
-----------------------
Private Sub WelcomeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WelcomeButton.Click

Dim objLoginForm As New LoginForm
objLoginForm.Show()
Me.hide()

End Sub
---------------------

----------
login form
-----------
Private Sub LoginButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoginButton.Click
Dim objExitForm As New ExitForm
objExitForm.Show()
Me.hide()

End Sub
-------------

------------
exit form
-------------
Private Sub ExitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButton.Click
Dim Form1 As New LoginForm
Dim Form2 As New WelcomeForm
Form1.Close()
Form2.Close()
Me.Close()
End Sub
-----------------------
 
oh my friend rborel.... you are an angel..........
thank you buddy............... :))))))))
i had been working on it for the whole night........
and it was only three lettersssssssssssssssssssssss answer.......................i.e. End
thank you
 
Heh, You asked about the only thing I CAN do in programming. . . . Exit the program. . .

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top