473,410 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

OnMouseOverOnMouseButtonDown...

Hi
I am creating a usercontrol which is inheriting from the UserControl class.
I would like to detect when the mouse is moved into the control when the
mouse button is down?
I have tried to use the OnMouseOver event, combined with some detection on
if the mouse button is down, but the OnMouseOver event does not seem to be
fired at all.
Does anybody have an suggestion on how to do this?

Regards
Thorbjørn
Nov 16 '05 #1
3 1150
Try to use the OnMouseMove event.
I don't understand exactly why you need to know if the mouse button is
pressed when it's moving on your control. If you try to catch a DragDrop
session, you should use the appropriate event, for example OnDragEnter,
OnDragOver, etc...

HTH,
Mephiston

"Thorbjørn Jørgensen @softdoc.dk>" <thorbjorn<REMOVE> ha scritto nel
messaggio news:41***********************@news.sunsite.dk...
Hi
I am creating a usercontrol which is inheriting from the UserControl class. I would like to detect when the mouse is moved into the control when the
mouse button is down?
I have tried to use the OnMouseOver event, combined with some detection on
if the mouse button is down, but the OnMouseOver event does not seem to be
fired at all.
Does anybody have an suggestion on how to do this?

Regards
Thorbjørn

Nov 16 '05 #2
Hi Mephiston
Try to use the OnMouseMove event.
I don't understand exactly why you need to know if the mouse button is
pressed when it's moving on your control. If you try to catch a DragDrop
session, you should use the appropriate event, for example OnDragEnter,
OnDragOver, etc...


I know that the post was not that well informative but I tried to simplify
the question. I am creating a table like control where each cell is
inheriated from the UserControl Class. To be able to do a selection of
multiple cells i need to detect when the mouse enters a cell and the mouse
button is pressed down. I think i have tried the Drag events but could not
make them work. I do not know why, but it could be that no object is
actually dragged or some thing?
I hope this describes what I want to do a little more clearly and that some
body have a suggestion on how to overcome this problem...

Regards
Thorbjørn
Nov 16 '05 #3
Hi,
Now the problem is more clear.
At the moment I really don't know if there is a way to catch the event that
you need.

Alternatively, you can set a flag when the right mouse button in pressed on
or released on a UserControl, then when the OnMouseMove event is raised by
another control, you can check that flag to know if the right mouse button
is still pressed and so you can do what you need to.

HTH,
Mephiston

"Thorbjørn Jørgensen @softdoc.dk>" <thorbjorn<REMOVE> ha scritto nel
messaggio news:41***********************@news.sunsite.dk...
Hi Mephiston
Try to use the OnMouseMove event.
I don't understand exactly why you need to know if the mouse button is
pressed when it's moving on your control. If you try to catch a DragDrop
session, you should use the appropriate event, for example OnDragEnter,
OnDragOver, etc...
I know that the post was not that well informative but I tried to simplify
the question. I am creating a table like control where each cell is
inheriated from the UserControl Class. To be able to do a selection of
multiple cells i need to detect when the mouse enters a cell and the mouse
button is pressed down. I think i have tried the Drag events but could not
make them work. I do not know why, but it could be that no object is
actually dragged or some thing?
I hope this describes what I want to do a little more clearly and that

some body have a suggestion on how to overcome this problem...

Regards
Thorbjørn

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.