Click to See Complete Forum and Search --> : MessageBox with answer returns


Shaitan00
March 12th, 2005, 02:15 AM
--Using [VS C#.NET]--

This is a really simple question...
How do you make a message box that has a YES/NO and returns a boolean depending on the users response.
Specifically I want to prompt the user to confirm if he wants to delete the seletected item.
So like if (messagebox.response) then XXX else YYY type of pseudo-code.

I am sure this is rather trivial just couldn't find any clear examples.
Thanks,

hspc
March 12th, 2005, 02:24 AM
I wish this can help..

DialogResult res= MessageBox.Show(this,"Delete ?","confirm",MessageBoxButtons.YesNo);
if(res==DialogResult.No)
return;
else
//Delete