Exemple #1
0
        public static DialogResult Show(Control parent, string message, string title, Buttons buttons, Icon icon)
        {
            _msgBox                  = new MessageBox();
            _msgBox.Parent           = parent;
            _msgBox._lblMessage.Text = message;
            _msgBox.Text             = title;

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

            _msgBox.Size = _msgBox.MessageSize(message);
            _msgBox.ShowDialog();

            return(_buttonResult);
        }
Exemple #2
0
        public static DialogResult Show(Control parent, string message, string title, Buttons buttons, Icon icon, AnimateStyle style)
        {
            _msgBox = new MessageBox();
            //_msgBox.Socket = parent.Socket;
            _msgBox._lblMessage.Text = message;
            _msgBox.Text             = title;
            _msgBox.Height           = 0;

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

            _timer = new Timer();
            Size formSize = _msgBox.MessageSize(message);

            switch (style)
            {
            case MessageBox.AnimateStyle.SlideDown:
                _msgBox.Size    = new Size(formSize.Width, 0);
                _timer.Interval = 1;
                _timer.Tag      = new AnimateMsgBox(formSize, style);
                break;

            case MessageBox.AnimateStyle.FadeIn:
                _msgBox.Size    = formSize;
                _msgBox.Opacity = 0;
                _timer.Interval = 20;
                _timer.Tag      = new AnimateMsgBox(formSize, style);
                break;

            case MessageBox.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();

            return(_buttonResult);
        }