public static void Show(IWin32Window owner, ref frmMsg fMsg, string msg, string title) { if (fMsg == null || fMsg.IsDisposed) { fMsg = new frmMsg(msg, title); fMsg.Show(owner); } else { fMsg.Title = title; fMsg.Message = msg; } //if (fMsg.Visible == false) fMsg.Visible = true; }
public static DialogResult Show(string msg, string title = "", MessageBoxButtons buttons = MessageBoxButtons.OK, MessageBoxIcon icon = MessageBoxIcon.Information, MessageBoxDefaultButton defaultButton = MessageBoxDefaultButton.Button1) { var fMsg = new frmMsg(msg, title, buttons, icon, defaultButton); fMsg.Text = title; DialogResult dResult = DialogResult.OK; if (buttons == MessageBoxButtons.OK && icon == MessageBoxIcon.Information) { fMsg.Show(); } else { dResult = fMsg.ShowDialog(); } return(dResult); }