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.


Jignesh TrivediRank #16 · 50.3K reputationPosted Feb 12, 2013, 10:21 PM EST
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.
Sivaraman DhamodaranRank #40 · 34.5K reputationPosted Feb 12, 2013, 10:58 PM EST