Exemple #1
0
 public static bool SweetAlert(ShowBoxType type, string msg)
 {
     using (var form = new ShowBox(type, msg))
     {
         var result = form.ShowDialog();
         if (result == DialogResult.OK)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Exemple #2
0
 public ShowBox(ShowBoxType ptype, string pmsg = "")
 {
     InitializeComponent();
     type       = ptype;
     lbMsg.Text = pmsg;
     if (ptype == ShowBoxType.alert)
     {
         panelAlert.Visible   = true;
         panelConfirm.Visible = false;
     }
     else
     {
         panelAlert.Visible   = false;
         panelConfirm.Visible = true;
     }
 }