Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7458469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:27:05+00:00 2026-05-29T13:27:05+00:00

I was creating some complex applications in Visual Basic .NET 2008 and since they

  • 0

I was creating some complex applications in Visual Basic .NET 2008 and since they are in the testing phase right now, people manage to find an error or two every so often that causes the program to crash. The problem is that there is a tracking piece to it that logs who is currently using the programs. When a user logs in, it logs that they are currently logged in, and if the form close event is fired, the log is deleted to show that they have closed it.

Now my problem comes whenever the form crashes from an error since it won’t trigger the close event and therefore makes the log become inaccurate. My question is if it is possible to capture any error that the form would have in the form of an event?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T13:27:06+00:00Added an answer on May 29, 2026 at 1:27 pm

    Try double-clicking on “My Project” in the Solution Explorer.

    On the “Application” tab, toward the bottom is a “View Application Events” button. Click it.

    You should see an “ApplicationEvents” file. Select the UnhandledException event.

    It should look like this:

    Namespace My
    
      ' The following events are available for MyApplication:
      ' 
      ' Startup: Raised when the application starts, before the startup form is created.
      ' Shutdown: Raised after all application forms are closed.  This event is not raised if the application terminates abnormally.
      ' UnhandledException: Raised if the application encounters an unhandled exception.
      ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. 
      ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
      Partial Friend Class MyApplication
    
        Private Sub MyApplication_UnhandledException(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs) Handles Me.UnhandledException
          // log your exception here.
        End Sub
      End Class
    
    End Namespace
    

    Note: this event will not fire while a debugger is attached.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Sencha Touch and now engaged in creating some complex banking
I'm fairly new to Visual Studio (specifically Visual Basic .NET) but have been programming
I'd appreciate people's thoughts on a dilemma I've been struggling with ever since ASP.NET
We are creating a new HR application (.NET) that requires printing of complex forms
Right now i'm trying to narrow a complex subversion problem and performing lots of
I'm creating some custom work items in TFS and the helptext field seems handy
I am creating some build scripts that interact with Perforce and I would like
I'm creating some text boxes on my form programmatically which I need to reference
I am considering creating some JSP-tags that will always give the same output. For
I'm creating some videos from a collection of images, I subsequently wish to play

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.