Message box does not work in release mode

Posted by Bi on Stack Overflow See other posts from Stack Overflow or by Bi
Published on 2010-06-17T19:34:30Z Indexed on 2010/06/17 19:43 UTC
Read the original article Hit count: 160

Filed under:

I have the following code in a C# windows form application.

if (myGrid.Rows.Count != 0)
{
     // do something
}
else
{
     MessageBox.Show("Test");
}

The message box shows up in Debug mode but not in release mode. Any idea why?

I am having similar issues with other code as well

For instance

 if (!myParameter)
     this.mycheckBox.Enabled = false;
 else
     this.mycheckBox.Enabled = true; 

The above code works in debug mode not in release. Not sure why.

Thanks

© Stack Overflow or respective owner

Related posts about c#