public static Result Show(IWin32Window parent, string text, string caption, string checkBoxText, bool isChecked, string[] buttons, int[] results, string cancelButton, string acceptButton) { using (MessageBoxWithCheckBox messageBox = new MessageBoxWithCheckBox(text, caption, checkBoxText, isChecked, buttons, results, cancelButton, acceptButton)) { if (parent == null) { messageBox.StartPosition = FormStartPosition.CenterScreen; } return(messageBox.Show(parent)); } }
public static Result ShowYesNo(IWin32Window parent, string text, string caption, string checkBoxText, bool isChecked) { using (MessageBoxWithCheckBox messageBox = new MessageBoxWithCheckBox(text, caption, checkBoxText, isChecked, new string[] { BUTTON_YES, BUTTON_NO }, new int[] { (int)DialogResult.Yes, (int)DialogResult.No }, BUTTON_NO, BUTTON_YES)) { if (parent == null) { messageBox.StartPosition = FormStartPosition.CenterScreen; } return(messageBox.Show(parent)); } }
public ButtonClick(MessageBoxWithCheckBox parent, string text, int dlgResult, int id) { _parent = parent; _id = id; _dlgResult = dlgResult; _button = new Button(); _button.FlatStyle = FlatStyle.System; _button.TabIndex = _tabIndex++; _button.Text = text; _button.Click += _button_Click; _parent.Controls.Add(_button); }