public static string ShowBox(string txtMessage) { newMB = new MyCMB(); newMB.lblMessage.Text = txtMessage; newMB.ShowDialog(); return(Button_id); }
public static string ShowBox(string txtMessage, string txtTitle, int delay) { disposeFormTimer = delay; newMB = new MyCMB(); newMB.lblTitle.Text = txtTitle; newMB.lblMessage.Text = txtMessage; newMB.ShowDialog(); return(Button_id); }
void Button2Click(object sender, EventArgs e) { try{ string result = MyCMB.ShowBox("Do you want to exit? \n This Dialog will close automaticaly after 10 sec", "Exit", 10); if (result.Equals("1")) { MessageBox.Show("OK Button was Clicked"); } else if (result.Equals("2")) { MessageBox.Show("Cancel Button was Clicked"); } }catch { } }