Reputation: 105
I had seen lot of explanation about the possible reasons behind Red X after googling. Our application displaying only certain systems and only at rare times. Can any body suggest me test case to produce Big Red X in any c# controls preferably DataGrid. I checked the test case given in blog http://www.sturmnet.org/blog/2005/03/23/red-x ,but no way to produce. My main intention is to do some R & D about this issue
Upvotes: 3
Views: 5563
Reputation: 26454
The big red X occurs when an unhandled exception is being thrown during a Paint
event. To reproduce, create the following test class:
public class MyButton : Button
{
protected override void OnPaint(System.Windows.Forms.PaintEventArgs pevent)
{
throw new Exception("my test exception");
}
}
Build and place this component onto your form. When you start the app, you will see the following image:
You are also likely to see this error for the first time it fails to do Paint
:
Upvotes: 2