Last active
June 6, 2018 07:02
-
-
Save k33ptoo/41c0eabaf76f68e654e1 to your computer and use it in GitHub Desktop.
C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override CreateParams CreateParams | |
{ | |
get | |
{ | |
const int CS_DROPSHADOW = 0x20000; | |
CreateParams cp = base.CreateParams; | |
cp.ClassStyle |= CS_DROPSHADOW; | |
cp.ExStyle |= 0x02000000; // Turn on WS_EX_COMPOSITED | |
return cp; | |
} | |
} | |
//add shadow | |
//reduce flicker | |
//add to root of form. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main() | |
{ | |
Application.EnableVisualStyles(); | |
Application.SetCompatibleTextRenderingDefault(false); | |
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); | |
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); | |
Application.Run(new Form1()); | |
} | |
static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) | |
{ | |
MessageBox.Show(e.Exception.Message, "Unhandled Thread Exception"); | |
} | |
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) | |
{ | |
MessageBox.Show((e.ExceptionObject as Exception).Message, "Unhandled UI Exception"); | |
// here you can log the exception ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment