Exit window button would not terminate
I am not able to get the exit window button to terminate once I click on it.
I am not sure what I am doing wrong.
This is the code I am using for it: btnExitWindow.Enabled = True. Everything else is working fine when I run the program. Could anyone help.
Private Sub btnExitWindow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExitWindow.Click
' This code is executed when the user clicks the
' exit button. The exit window button terminates
' and closes the application.
btnBankingHours.Enabled = False
btnExitWindow.Enabled = True
End Sub
End Class
Re: Exit window button would not terminate
Private Sub btnExitWindow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExitWindow.Click
' This code is executed when the user clicks the
' exit button. The exit window button terminates
' and closes the application.
btnBankingHours.Enabled = False
btnExitWindow.Enabled = True
End Sub
End Class
Re: Exit window button would not terminate
Welcome to VBForums :wave:
Thread moved from the 'VB6 and Earlier' forum to the 'VB.Net' (VB2002 and later) forum
Re: Exit window button would not terminate
you're code doesn't do anything... just sets the enabled property of a couple of buttons... to include the one you just clicked....
-tg
Re: Exit window button would not terminate
Quote:
Originally Posted by
Janiyah
I am not able to get the exit window button to terminate once I click on it.
I am not sure what I am doing wrong.
This is the code I am using for it: btnExitWindow.Enabled = True. Everything else is working fine when I run the program. Could anyone help.
Private Sub btnExitWindow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExitWindow.Click
' This code is executed when the user clicks the
' exit button. The exit window button terminates
' and closes the application.
btnBankingHours.Enabled = False
btnExitWindow.Enabled = True
End Sub
End Class
Turning on and off buttons won't exit an application....try:
Re: Exit window button would not terminate
Sean Grebey is right you need to write Me.Close() when the button is clicked
Re: Exit window button would not terminate
this is how your btnExitWindow code should look exactly.
vb Code:
Private Sub btnExitWindow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExitWindow.Click
Me.Close()
End Sub
Re: Exit window button would not terminate
I think you should mark the thread as resolved now
Re: Exit window button would not terminate
Not exactly. Me.close will only terminate based on set application properties
Application.Exit is what you should be using.