Esempio n. 1
0
        private void Button_MouseEnter(object sender, EventArgs e)
        {
            NoFocusCuesButton btn = sender as NoFocusCuesButton;

            int R = btn.BackColor.R;
            int G = btn.BackColor.G;
            int B = btn.BackColor.B;

            for (int i = 0; i < 10; i++)
            {
                btn.BackColor = Color.FromArgb(R + i * 2, G + i * 2, B + i * 2);
                btn.FlatAppearance.BorderColor        = Color.FromArgb(R + i * 2, G + i * 2, B + i * 2);
                btn.FlatAppearance.MouseOverBackColor = Color.FromArgb(R + i * 2, G + i * 2, B + i * 2);
                btn.Refresh();
                Thread.Sleep(10);
            }
        }
Esempio n. 2
0
        private void Button_MouseUp(object sender, MouseEventArgs e)
        {
            NoFocusCuesButton btn = sender as NoFocusCuesButton;

            int R = btn.FlatAppearance.MouseDownBackColor.R;
            int G = btn.FlatAppearance.MouseDownBackColor.G;
            int B = btn.FlatAppearance.MouseDownBackColor.B;

            for (int i = 0; i < 10; i++)
            {
                btn.FlatAppearance.BorderColor        = Color.FromArgb(R - i * 2, G - i * 2, B - i * 2);
                btn.FlatAppearance.MouseOverBackColor = Color.FromArgb(R - i * 2, G - i * 2, B - i * 2);
                btn.FlatAppearance.MouseDownBackColor = Color.FromArgb(R - i * 2, G - i * 2, B - i * 2);
                btn.Refresh();
                Thread.Sleep(10);
            }

            Form2 form2 = new Form2();

            form2.Show();
        }