Click here to Skip to main content
15,894,291 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to control of message box in vb.net
how to get action when cliuck ok on message box
thats mean when click ok in msgbox translate in to new form
i know you can help me by coding
thanks and am sorry about this noise ;)
Posted

Hi
to get the button click from a message box

C#
DialogResult result = MessageBox.Show("Do you really want to continue?", "Test Dialog", MessageBoxButtons.YesNo);
if (result.ToString()=="Yes")
{
    //Do something
 }


there are 21 overloaded methods there for control the display of the messagebox
 
Share this answer
 
Comments
Nish Nishant 19-Feb-11 19:34pm    
Good answer, voted 5.
Albin Abel 19-Feb-11 23:30pm    
Thanks Nishant
if(result = DialogResult.Cancel)
{
//Do something
}
 
Share this answer
 

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