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 8994799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:30:33+00:00 2026-06-15T23:30:33+00:00

I have used Application.ThreadException and AppDomain.CurrentDomain.UnhandledException before but usually I only use this for

  • 0

I have used Application.ThreadException and AppDomain.CurrentDomain.UnhandledException before but usually I only use this for a single form. So usually I would use the Main in Program.cs.

try {
    AppDomain.CurrentDomain.UnhandledException += (sender, e) => .Handle(sender, (Exception)e.ExceptionObject);
    Application.ThreadException += (sender, e) => ExceptionHandler.Handle(sender, e.Exception);
    Application.Run(ApplicationBase);
} catch (Exception ex) {
    MessageBox.Show("Handled Exception");
}

In my new situation however I have a host of forms for my current project with a single base form that the other forms inherit from.

What I am trying to do is handle exceptions that are thrown in a derived form within code from the base form – I plonked the above code into my base’s constructor hoping I could do it that way but when there is an exception, it doesn’t hit the event.

Any reason why I can’t do this in the constructor and any alternatives?

NOTE: I previously asked this in Vb.net instead of C# so deleted my previous question and refactored my code so I could have a C# answer.

  • 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-06-15T23:30:33+00:00Added an answer on June 15, 2026 at 11:30 pm

    Those events are global events; they have nothing to do with individual forms.

    You can keep your current code in Main() and it will work fine with multiple forms. (unless you have multiple UI threads)

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

Sidebar

Related Questions

i have used impersonation in this application. whenever this error occurs i required to
I have used geocoder in my ruby on rails application for a while but
i have used progress bar in my application..my application is working fine but the
I have a form in my vb.net application used to take the data about
I have used a JPG for backgroundImage for an application form. My question is
In my application I have used one alert box.. In this alert box, I
I have used the coin slider in my application.But the coin slider is restricted
I have used facebook application for one of my android application. But i need
In my application I have used Asp.Net Form Authentication, FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
I have used UITextView in my application. Now this might be a dumb question

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.