コード例 #1
0
 private void UpdateTheme()
 {
     ForeColor = ThemeConverter.GetForeColor(Theme);
     BackColor = ThemeConverter.GetColor(Theme);
     FlatAppearance.MouseDownBackColor = ThemeConverter.GetBackColor(Theme);
     FlatAppearance.MouseOverBackColor = ThemeConverter.GetColor(Theme);
 }
コード例 #2
0
        public MetroButton() : base()
        {
            Text = "□→";
            FlatAppearance.BorderSize = 0;
            FlatStyle = FlatStyle.Flat;

            ForeColor = ThemeConverter.GetForeColor(Theme);
            BackColor = ThemeConverter.GetColor(Theme);
            FlatAppearance.MouseDownBackColor = ThemeConverter.GetBackColor(Theme);
            FlatAppearance.MouseOverBackColor = ThemeConverter.GetColor(Theme);

            Font = new Font("Segoe UI Light", 15F, FontStyle.Regular, GraphicsUnit.Pixel);
            Size = new Size(145, 145);

            DoubleBuffered = true;

            MouseDown += delegate(object sender, MouseEventArgs mevent)
            {
                Down_click = true;
            };

            MouseUp += delegate(object sender, MouseEventArgs mevent)
            {
                Down_click = false;
                Invalidate();
            };
        }