MoonCheck.cs 816 B

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