Esempio n. 1
0
        public static DialogResult Show(string message, string title, Buttons buttons, Icons icon, System.Windows.Window win)
        {
            win.ApplyEffect();

            var msgBox = new MsgBox
            {
                StartPosition = FormStartPosition.CenterParent,
                _lblMessage = { Text = message },
                _lblTitle = { Text = title }
            };

            msgBox.InitButtons(buttons);
            msgBox.InitIcon(icon);

            msgBox.Size = msgBox.MessageSize(message, title);

            ShowForm(msgBox);

            MessageBeep(0);

            win.ClearEffect();

            return msgBox._buttonResult;
        }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
        public static DialogResult Show(string message, System.Windows.Window win)
        {
            win.ApplyEffect();

            var msgBox = new MsgBox { StartPosition = FormStartPosition.CenterParent, _lblMessage = { Text = message } };

            msgBox.InitButtons(Buttons.OK);

            msgBox.Size = msgBox.MessageSize(message, "");

            ShowForm(msgBox);

            MessageBeep(0);

            win.ClearEffect();

            return msgBox._buttonResult;
        }