Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
How can i store and compare the Message box result.

Like i am alerting the user by Message box.
Based on the user selects ok or cancel. i need to proceed

but how can i know wat the user selected.
Posted
Comments
dadan muslih 2023 16-Dec-23 17:27pm    
How to handle try catch with messageBox

1 solution

if (MessageBox.Show(message, caption, MessageBoxButton.OKCancel) == MessageBoxResult.OK)
{
//Do something
}
else
{
//Do something else
}
 
Share this answer
 
Comments
subhash04573 10-Dec-10 0:39am    
MessageBoxResult is not coming in C#

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900