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