I am trying to make a dark mode for my Windows forms app but am getting and error. Never set any property of my form to read only neither can I find and option to set it to read only
public void TemniNacin()
{
LetalskaDruzba.DefaultBackColor = Color.Black;
foreach (var textboxi in Controls.OfType<TextBox>())
{
textboxi.BackColor= Color.Black;
textboxi.ForeColor = Color.White;
}
}
error is happening in the 3rd line