I am making a sudoku game on C# .NET desktop.
The sudokupanel consists of 81 labels. I define their number on the board with a algorithm.
Now what I want to do is basically this:
foreach(Label l in panel1.Controls.OfType<Label>())
{
if(l.MouseEnter == true)
{
l.ForeColor = Color.White;
}
}
But it doesn't work. Are there any solutions for this? Sorry I don't know how to use events in if statements.
EDIT: I've decided to just use the event MouseEnter for every label one by one. I know that CS 8.0 should support using events inside foreach stuff but not sure.