I am working windows application using c#.
A message box is appearing with ok button and i want to no code to execute after ok button click. I am writing return after message box but problem is it is coming out that method but still executes method which are calling this method.

Sivaraman DhamodaranPosted Feb 13, 2013, 3:58 AM
Jignesh TrivediPosted Feb 13, 2013, 3:21 AM
hi,
you may use following code to hold up your code.
try...
var result = MessageBox.Show("test", "test", MessageBoxButtons.OKCancel);
if (result == DialogResult.OK)
{
// do some thing.....
}
hope this will help you.