the me.close function does not close immediately. How can i do it ?
Printable View
the me.close function does not close immediately. How can i do it ?
What do you mean? Are you wanting the .NET equivelent to VB 6's END function? If so I believe its Application.Exit.
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:
Unfortunately the Close() call does absolutely nothing...Code:Try
' Do some risky stuff here
Catch
' Show error message
MyBase.Close()
End Try
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.
Wouldn't Me.Close work in your case KHolden?
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...