Results 1 to 9 of 9

Thread: Exit window button would not terminate

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2011
    Posts
    2

    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

  2. #2

    Thread Starter
    New Member
    Join Date
    Nov 2011
    Posts
    2

    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

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618

    Re: Exit window button would not terminate

    Quote Originally Posted by Janiyah View Post
    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:

    Code:
    Me.Close()
    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.

  6. #6
    Lively Member
    Join Date
    Oct 2011
    Posts
    121

    Re: Exit window button would not terminate

    Sean Grebey is right you need to write Me.Close() when the button is clicked

  7. #7
    New Member
    Join Date
    Nov 2011
    Posts
    2

    Re: Exit window button would not terminate

    this is how your btnExitWindow code should look exactly.
    vb Code:
    1. Private Sub btnExitWindow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExitWindow.Click
    2.  
    3. Me.Close()
    4.  
    5. End Sub

  8. #8
    Lively Member
    Join Date
    Oct 2011
    Posts
    121

    Re: Exit window button would not terminate

    I think you should mark the thread as resolved now

  9. #9
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,401

    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
  •  



Click Here to Expand Forum to Full Width