private void StylizeButton(MetroButton button, bool hovered)
        {
            button.Cursor = Cursors.Hand;

            button.MouseClick -= button_MouseClick;
            button.MouseClick += button_MouseClick;

            button.MouseEnter -= button_MouseEnter;
            button.MouseEnter += button_MouseEnter;

            button.MouseLeave -= button_MouseLeave;
            button.MouseLeave += button_MouseLeave;

            if (hovered)
            {
                button.FlatAppearance.BorderColor = Color.FromArgb(255, 102, 102, 102);
                button.ForeColor = Color.FromArgb(255, 255, 255, 255);
            }
            else
            {
                button.BackColor = Color.FromArgb(255, 238, 238, 238);
                button.FlatAppearance.BorderColor = Color.SlateGray;
                //button.FlatAppearance.BorderColor = Color.Red;
                button.FlatAppearance.MouseOverBackColor = Color.FromArgb(255, 102, 102, 102);
                button.ForeColor = Color.FromArgb(255, 0, 0, 0);
                button.FlatAppearance.BorderSize = 1;
            }
            button.Font = new Font("微软雅黑", 11f, FontStyle.Regular, GraphicsUnit.Pixel);
        }
        private void button_MouseClick(object sender, MouseEventArgs e)
        {
            MetroButton button = (MetroButton)sender;

            button.BackColor = Color.FromArgb(255, 51, 51, 51);
            button.FlatAppearance.BorderColor = Color.FromArgb(255, 51, 51, 51);
            button.ForeColor = Color.FromArgb(255, 255, 255, 255);
        }
        private void button_Click(object sender, EventArgs e)
        {
            MetroButton button = (MetroButton)sender;

            if (!button.Enabled)
            {
                return;
            }
            _result = (DialogResult)button.Tag;
            Hide();
        }
 private void StylizeButton(MetroButton button)
 {
     StylizeButton(button, false);
 }
 private void EnableButton(MetroButton button, bool enabled)
 {
     button.Enabled = enabled; button.Visible = enabled;
 }
 private void EnableButton(MetroButton button)
 {
     EnableButton(button, true);
 }