/// <summary> /// MButtons: Display CYButtons on the message box. /// </summary> static public DialogResult Show(string Message, string Title, CYButtons MButtons) { BuildMessageBox(Title); // BuildMessageBox method, responsible for creating the MessageBox frmTitle.Text = Title; // Set the title of the MessageBox frmMessage.Text = Message; //Set the text of the MessageBox ButtonStatements(MButtons); // ButtonStatements method is responsible for showing the appropreiate buttons newMessageBox.ShowDialog(); // Show the MessageBox as a Dialog. return(CYReturnButton); // Return the button click as an Enumerator }
/// <summary> /// MIcon: Display CYIcon on the message box. /// </summary> static public DialogResult Show(string Message, string Title, CYButtons MButtons, CYIcon MIcon) { BuildMessageBox(Title); frmTitle.Text = Title; frmMessage.Text = Message; ButtonStatements(MButtons); IconStatements(MIcon); Image imageIcon = new Bitmap(frmIcon.ToBitmap(), 38, 38); pIcon.Image = imageIcon; newMessageBox.ShowDialog(); return(CYReturnButton); }
static private void ButtonStatements(CYButtons MButtons) { if (MButtons == CYButtons.AbortRetryIgnore) { ShowIgnoreButton(); ShowRetryButton(); ShowAbortButton(); } if (MButtons == CYButtons.OK) { ShowOKButton(); } if (MButtons == CYButtons.OKCancel) { ShowCancelButton(); ShowOKButton(); } if (MButtons == CYButtons.RetryCancel) { ShowCancelButton(); ShowRetryButton(); } if (MButtons == CYButtons.YesNo) { ShowNoButton(); ShowYesButton(); } if (MButtons == CYButtons.YesNoCancel) { ShowCancelButton(); ShowNoButton(); ShowYesButton(); } if (MButtons == CYButtons.CancelLocateDownload) { ShowDownloadButton(); ShowLocateButton(); ShowCancelButton(); } }
private static void ButtonStatements(CYButtons MButtons) { if (MButtons == CYButtons.AbortRetryIgnore) { ShowIgnoreButton(); ShowRetryButton(); ShowAbortButton(); } if (MButtons == CYButtons.OK) { ShowOKButton(); } if (MButtons == CYButtons.OKCancel) { ShowCancelButton(); ShowOKButton(); } if (MButtons == CYButtons.RetryCancel) { ShowCancelButton(); ShowRetryButton(); } if (MButtons == CYButtons.YesNo) { ShowNoButton(); ShowYesButton(); } if (MButtons == CYButtons.YesNoCancel) { ShowCancelButton(); ShowNoButton(); ShowYesButton(); } }
/// <summary> /// MIcon: Display CYIcon on the message box. /// </summary> public static DialogResult Show(string Message, string Title, CYButtons MButtons, CYIcon MIcon) { BuildMessageBox(Title); //frmTitle.Text = Title; frmMessage.Text = Message; ButtonStatements(MButtons); IconStatements(MIcon); pIcon.Image = imgIcon; newMessageBox.ShowDialog(); return CYReturnButton; }
/// <summary> /// MButtons: Display CYButtons on the message box. /// </summary> public static DialogResult Show(string Message, string Title, CYButtons MButtons) { BuildMessageBox(Title); // BuildMessageBox method, responsible for creating the MessageBox //frmTitle.Text = Title; // Set the title of the MessageBox frmMessage.Text = Message; //Set the text of the MessageBox ButtonStatements(MButtons); // ButtonStatements method is responsible for showing the appropreiate buttons newMessageBox.ShowDialog(); // Show the MessageBox as a Dialog. return CYReturnButton; // Return the button click as an Enumerator }
/// <summary> /// MIcon: Display CYIcon on the message box. /// </summary> public static DialogResult Show(IWin32Window pCtrl, string Message, string Title, CYButtons MButtons, CYIcon MIcon) { BuildMessageBox(Title); //frmTitle.Text = Title; frmMessage.Text = Message; ButtonStatements(MButtons); IconStatements(MIcon); pIcon.Image = imgIcon; newMessageBox.ShowDialog(pCtrl); if (btnYes == null) return DialogResult.OK; if (btnYes.Visible) btnYes.Focus(); else if (btnRetry.Visible) btnRetry.Focus(); return CYReturnButton; }