public static DialogResult Show(string message, string title, Buttons buttons, Icons icon, AnimateStyle style, System.Windows.Window win) { win.ApplyEffect(); _msgBox = new MsgBox(); _msgBox.StartPosition = FormStartPosition.CenterParent; _msgBox._lblMessage.Text = message; _msgBox._lblTitle.Text = title; _msgBox.Height = 0; MsgBox.InitButtons(buttons); MsgBox.InitIcon(icon); _timer = new Timer(); Size formSize = MsgBox.MessageSize(message); switch (style) { case AnimateStyle.SlideDown: _msgBox.Size = new Size(formSize.Width, 0); _timer.Interval = 1; _timer.Tag = new AnimateMsgBox(formSize, style); break; case AnimateStyle.FadeIn: _msgBox.Size = formSize; _msgBox.Opacity = 0; _timer.Interval = 20; _timer.Tag = new AnimateMsgBox(formSize, style); break; case AnimateStyle.ZoomIn: _msgBox.Size = new Size(formSize.Width + 100, formSize.Height + 100); _timer.Tag = new AnimateMsgBox(formSize, style); _timer.Interval = 1; break; } _timer.Tick += timer_Tick; _timer.Start(); _msgBox.ShowDialog(); MessageBeep(0); win.ClearEffect(); return(_buttonResult); }
public static DialogResult Show(string message, string title, Buttons buttons, Icons icon, System.Windows.Window win) { win.ApplyEffect(); _msgBox = new MsgBox(); _msgBox.StartPosition = FormStartPosition.CenterParent; _msgBox._lblMessage.Text = message; _msgBox._lblTitle.Text = title; MsgBox.InitButtons(buttons); MsgBox.InitIcon(icon); _msgBox.Size = MsgBox.MessageSize(message); _msgBox.ShowDialog(); MessageBeep(0); win.ClearEffect(); return(_buttonResult); }