PDA

Click to See Complete Forum and Search --> : MessageBox problem..


daimous
Jun 27th, 2006, 01:18 AM
hi! i have a MessageBox with Yes and No button in it...my question is, how will I know if the User pressed Yes or No...thanks in advance!!!

jmcilhinney
Jun 27th, 2006, 01:27 AM
MessageBox.Show returns a Windows.Forms.DialogResult value that corresponds to the button that was pressed, e.g.if (MessageBox.Show("Are you attractive?",
"Beauty Quest",
MessageBoxButtons.YesNo ,
MessageBoxIcon.Question) == DialogResult.Yes)
{
MessageBox.Show("Liar! You are butt ugly.");
}
else
{
MessageBox.Show("I agree. You are butt ugly.");
}

daimous
Jun 27th, 2006, 01:57 AM
ok thanks so much!!!