Do you mean that you're using a MessageBox with YesNo buttons?
If so, you need to capture the result of the MessageBox and check it against DialogResult.Yes as in:
DialogResult result;
result = MessageBox.Show("Do you want to save this?","Save Inception",MessageBoxButtons.YesNo);
if (result == DialogResult.Yes)