示例#1
0
        private static void InitButtons(Buttons buttons)
        {
            switch (buttons)
            {
            case MessageBox.Buttons.AbortRetryIgnore:
                _msgBox.InitAbortRetryIgnoreButtons();
                break;

            case MessageBox.Buttons.OK:
                _msgBox.InitOKButton();
                break;

            case MessageBox.Buttons.OKCancel:
                _msgBox.InitOKCancelButtons();
                break;

            case MessageBox.Buttons.RetryCancel:
                _msgBox.InitRetryCancelButtons();
                break;

            case MessageBox.Buttons.YesNo:
                _msgBox.InitYesNoButtons();
                break;

            case MessageBox.Buttons.YesNoCancel:
                _msgBox.InitYesNoCancelButtons();
                break;
            }

            foreach (Button btn in _msgBox._buttonCollection)
            {
                btn.ForeColor = Color.FromArgb(170, 170, 170);
                btn.Font      = new System.Drawing.Font("Segoe UI", 8);
                btn.Padding   = new Padding(3);
                btn.FlatStyle = FlatStyle.Flat;
                btn.Height    = 30;
                btn.FlatAppearance.BorderColor = Color.FromArgb(99, 99, 98);

                _msgBox._flpButtons.Controls.Add(btn);
            }

            _msgBox.StartPosition = FormStartPosition.CenterScreen;
        }