MouseMove Event on Panel Controls

J

Jason

I created a panel control and then place a rich text box inside the panel. I
set the richtext box so that it completely fills the entire panel. I want to
be able to handle a MouseMove event on the panel but when I add the event
handler it is never called. However if I put the event handler on the
richtext box it works fine, but I want it on the panel not the text box. any
ideas. I'm using this concept in a more advanced way but if I can figure out
why this is happening I'll be set. I even wrote a small little program
(exactly like described above to test this) but I could never get to call
the event handler of the panel.

Thanks
Jason
 
M

Mohamoss

Hi jason

This is a normal behavior, since the panel is filled with the RichTextBox
so you will never be able to fire that event on it ( since you are not
moving on it but on the RichTextBox). This is in fact the default , imagine
you wrote a handler for the mouse move on the form and a one for a mouse
move on the a button on the same form . if you move the mouse over the
button , only the handler of button_mouseMove will be fired ( this is not
considered a move on the form that is not have the button over it at that
location ) otherwise both events would be fired ( since the mouse is over
the button that is over the form ) but this doesn't happened . I hope this
clears why the event is not fired.

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top