Advertisement
BurningBunny

ThreadExceptionEventHandler_MainForm.cs

Jun 23rd, 2013
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. /*
  2.  * Created by Adam Rakaska
  3.  * -> http://arakaska.wix.com/intelligentsoftware
  4.  * -> http://csharpcodewhisperer.blogspot.com
  5.  */
  6.  
  7.  
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Drawing;
  11. using System.Windows.Forms;
  12.  
  13. using System.Threading;
  14.  
  15. namespace Example_ThreadExceptionHandler
  16. {
  17.     public partial class MainForm : Form
  18.     {
  19.         public MainForm()
  20.         {
  21.             InitializeComponent();
  22.         }
  23.        
  24.         // Global event handler
  25.         public static void MyExceptionHandler(object sender, ThreadExceptionEventArgs e) {
  26.             MessageBox.Show(e.Exception.Message,"Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement