I have a method, like that:
private void Form1_MouseEnter(object sender, EventArgs e)
{
Form1 form1 = (Form1)sender;
form1.Opacity = 1;
}
private void Form1_MouseLeave(object sender, EventArgs e)
{
Form1 form1 = (Form1)sender;
form1.Opacity = .5;
}
But when my mouse enters other form elements like buttons and other, the second method fires and the first one becomes inactive
I want the first method to work even when hovering over buttons and other form elements and gets inactive only when the mouse leave the form
I tried to give all form elements a subscription to the mouse hover event, but obviously this did not help (I did it out of desperation)