MoonCheck.cs 772 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4. namespace Optimizer {
  5. public sealed class MoonCheck : CheckBox {
  6. public MoonCheck() {
  7. DoubleBuffered = true;
  8. }
  9. protected override void OnCheckedChanged(EventArgs e) {
  10. base.OnCheckedChanged(e);
  11. // custom theming
  12. if (this.Checked) {
  13. this.Tag = "themeable";
  14. this.Font = new Font(this.Font, FontStyle.Underline);
  15. this.ForeColor = OptionsHelper.ForegroundColor;
  16. }
  17. else {
  18. this.Tag = string.Empty;
  19. this.ForeColor = Color.White;
  20. this.Font = new Font(this.Font, FontStyle.Regular);
  21. }
  22. }
  23. }
  24. }