• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

C# How do I just throw up an error dialog?

Alphathree33

Platinum Member
I've looked up and down the class library. I really don't want to write my own error form although it wouldn't be that hard, it just feels wrong in concept when I know there are plenty available through the Windows API, and I assume C# must expose some of them.
 
The link is correct, but it's MessageBox.Show, not MsgBox

Both VB.Net and C# support MessageBox.
VB.Net also supports the old VB MsgBox function, but it is outdated and you should use the new MessageBox class instead.
 
Originally posted by: Alphathree33
I've looked up and down the class library. I really don't want to write my own error form although it wouldn't be that hard, it just feels wrong in concept when I know there are plenty available through the Windows API, and I assume C# must expose some of them.



Code:
catch(Exception e)
				{
					System.Windows.Forms.MessageBox.Show(e.ToString(), "Critical: Unhandled error");
				}
 
Back
Top