c# - having a check box in message box -


this question has answer here:

in message box there 2 buttons, yes , no. want have checkbox inside of message box says do items , if button yes selected , true items , if no selected , true items.

is possible in messagebox?

the answer question no. cannot create messagebox checkbox. have create custom dialog box. need create form looks way wish , use showdialog() method display form. display modal dialog box in application. code after showdialog method not executed until dialog box closed.

using (form2 frm = new form2())             {                 frm.showdialog();                 if (frm.dialogresult == dialogresult.yes)                 {                  }                 else if (frm.dialogresult == dialogresult.no)                 {                  }             } 

on clicking yes or no within dialog box, following close dialog box dialogresult

  private void btnyes_click(object sender, eventargs e)         {             dialogresult = dialogresult.yes;         }    private void btnno_click(object sender, eventargs e)         {             dialogresult = dialogresult.no;         } 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -