public static void Show(string message, YesMethod yesMethod) { try { CustomYesNoBox custom = new CustomYesNoBox(message, yesMethod); custom.ShowDialog(); } catch (Exception ex) { CustomMessageBox.Show("Error : " + ex.Message); } }
private void buttonYes_Click(object sender, EventArgs e) { try { yesMethod?.Invoke(); yesMethod = null; this.Close(); } catch (Exception ex) { CustomMessageBox.Show("Error : " + ex.Message); } }
public CustomYesNoBox(string message, YesMethod yesMethod) { try { InitializeComponent(); labelPesan.Text = message; this.yesMethod = yesMethod; }catch (Exception ex) { CustomMessageBox.Show("Error : " + ex.Message); } }