Dragging the mouse over a control

  • Thread starter Thread starter ohadasor
  • Start date Start date
O

ohadasor

Hello,

I have a control which I need to act in a specific way when the user
drags the mouse on it. Means, that the user should click on the
control's one position, hold the mouse button, move it to another
position on the control, and releases the mouse. It isn't like drag and
drop, when two objects are interacting. Here I have only one control.

Also, I need to when the user also pressed the ctrl key while dragging.

Please help.

Thanks,
Ohad.
 
Hello,

I have a control which I need to act in a specific way when the user
drags the mouse on it. Means, that the user should click on the
control's one position, hold the mouse button, move it to another
position on the control, and releases the mouse. It isn't like drag and
drop, when two objects are interacting. Here I have only one control.

Also, I need to when the user also pressed the ctrl key while dragging.

Please help.

When the user clicks on the control you'll get the MouseDown event.
When the user moves the mouse you'll get MouseMove events.
When the user releases the mouse button you'll get the MouseUp event.

You can query the status of the Ctrl key with Control.ModifierKeys oder
use the KeyDown event.

hth,
Max
 
Back
Top