Form.Hide() doesn't work in MyApplication_UnhandledException()

Suriv

Active member
Joined
Jul 16, 2007
Messages
33
Programming Experience
1-3
I have a strange problem:
When I place this code in ApplicationEvents.vb
VB.NET:
Private Sub MyApplication_UnhandledException(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs) Handles Me.UnhandledException
            'hide forms
            frmMain.Hide()

            e.ExitApplication = False

           'more code

'end
End
        End Sub

All of it works, except frmMain.Hide() doesn't work.

Does anyone knows this problem? :)
 
'sender' for that event is the MyApplication class instance. 'sender' parameter of event handlers normally is an instance of the class that raised the event, only the class that defines an event can raise it.

Maybe you can get a reference to the form through the OpenForms collection?
 

Latest posts

Back
Top