Управление MouseHover и MouseLeave Events

Я строил простую форму с одним простым эффектом - уменьшенная непрозрачность, когда мышь не находится над формой, и форма становится непрозрачной, когда мышь находится над ней. В настоящее время я сталкиваюсь с несколькими трудностями:

Firstly, I did this-

 this.MouseHover += new EventHandler(Form1_MouseHover);
 this.MouseLeave += new EventHandler(Form1_MouseLeave);

But I had 1 richtextbox in form too, and as mouse went over it, the form lost opacity again. I had to add this too:-

 richTextBox1.MouseHover+=new EventHandler(Form1_MouseHover);
 richTextBox1.MouseLeave+=new EventHandler(Form1_MouseLeave);

wondering if there was any better way,because there is still some gap between richtextbox and form boundaries, and form is losing opacity when mouse cursor goes there.

If the mouse is NOT over the form (suppose initially), the form is less opaque. Now, I want form to become opaque as soon as mouse goes over it, but it only happens when mouse movement over form stops completely. If I keep moving mouse over the form, it does not become opaque. Is this a problem with the way events are stored in message queue and all that or will I be able to do something, because I have seen applications with the effect I am trying to implement.

Ответы на вопрос(4)

Ваш ответ на вопрос