BlueMystical / Dark-Mode-Forms

Apply Dark Mode to all Controls in a Form [WinForms]
GNU General Public License v3.0
111 stars 15 forks source link

incorrectly set ForeColor ? #37

Closed kachnitata closed 4 months ago

kachnitata commented 4 months ago

I am struggling with one form there are CheckBoxes contained in GroupBoxes. all the elements have default ForeColor, it is not explicitly set neither in the designer generated code nor in my own code. For some strange reason, texts within one of the GroupBoxes are black. I tried debugging it and found that when entering ThemeControl(), all CheckBoxes (the 'good' as well as the 'bad' ones) have ForeColor set to "{Name=ffb0b0b0, ARGB=(255, 176, 176, 176)}" , so this block is not executed for them:


      if (control.ForeColor == SystemColors.ControlText || control.ForeColor == SystemColors.WindowText)
      {
        control.GetType().GetProperty("ForeColor")?.SetValue(control, OScolors.TextActive);
      }

So far, I am not able to make any sense of it. Any suggestions?

image

kachnitata commented 4 months ago

my mistake.... I forgot that the GroupBox was programmatically set as "disabled"