Results 1 to 5 of 5

Thread: Immediately close a application

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2002
    Posts
    32

    Immediately close a application

    the me.close function does not close immediately. How can i do it ?

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    What do you mean? Are you wanting the .NET equivelent to VB 6's END function? If so I believe its Application.Exit.

  3. #3

    Post

    I'm having the same issue here. Here's the problem:

    Open a form using the .ShowDialog method
    During initialization I do some Try/Catch processing when handling data connections. In the event of an exception, I want to show the error and immediately close the form like this:
    Code:
    Try
        ' Do some risky stuff here
    Catch
        ' Show error message
        MyBase.Close()
    End Try
    Unfortunately the Close() call does absolutely nothing...

    The intent is not to bail completely out of the app, just terminate the offending form.

    fwiw, the MyBase.Close() fails outside of a Try/Catch as well... that's not the problem.

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Wouldn't Me.Close work in your case KHolden?

  5. #5
    No, Me.Close() in this instance is equivalent to MyBase.Close().

    For the sake of completeness I had also tried Me.Close() but this too did not close the dialog...

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