|
-
Nov 17th, 2011, 03:45 PM
#1
Thread Starter
New Member
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
-
Nov 17th, 2011, 03:46 PM
#2
Thread Starter
New Member
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
-
Nov 17th, 2011, 03:50 PM
#3
Re: Exit window button would not terminate
Welcome to VBForums 
Thread moved from the 'VB6 and Earlier' forum to the 'VB.Net' (VB2002 and later) forum
-
Nov 17th, 2011, 04:16 PM
#4
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
-
Nov 17th, 2011, 04:33 PM
#5
Frenzied Member
Re: Exit window button would not terminate
 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:
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
-
Nov 17th, 2011, 10:43 PM
#6
Lively Member
Re: Exit window button would not terminate
Sean Grebey is right you need to write Me.Close() when the button is clicked
-
Nov 17th, 2011, 10:59 PM
#7
New Member
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
-
Nov 18th, 2011, 05:34 PM
#8
Lively Member
Re: Exit window button would not terminate
I think you should mark the thread as resolved now
-
Nov 18th, 2011, 05:45 PM
#9
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.
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
|