STK X Send comments on this topic.
MouseMove Event (AgUiAxVOCntrl)
See Also  Example
Button
An integer that corresponds to the state of the mouse buttons in which a bit is set if the button is down. The Button argument is a bit field with bits corresponding to the left button (bit 0), right button (bit 1), and middle button (bit 2). These bits correspond to the values 1, 2, and 4, respectively. It indicates the complete state of the mouse buttons; some, all, or none of these three bits can be set, indicating that some, all, or none of the buttons are pressed.
Shift
An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys at the time of the event. The Shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2). These bits correspond to the values 1, 2, and 4, respectively. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed. For example, if both CTRL and ALT are pressed, the value of Shift is 6.
X
Returns a number that specifies the x-position of the current location of the mouse pointer. The x and y values are always expressed in terms of the control window coordinate system.
Y
Returns a number that specifies the y-position of the current location of the mouse pointer. The x and y values are always expressed in terms of the control window coordinate system.





Description

Occurs when the mouse pointer is moved across the control.

Syntax

[Visual Basic .NET]
Public Event MouseMove( _
   ByVal Button As Integer, _
   ByVal Shift As Integer, _
   ByVal X As Integer, _
   ByVal Y As Integer _
)

[C#]
public void MouseMove(
int Button,
int Shift,
int X,
int Y
);

[Managed C++]
public: void MouseMove(
int Button,
int Shift,
int X,
int Y
);

[Java]
public  mouseMove(
ppInteger Button,
ppInteger Shift,
int X,
int Y
);

[Unmanaged C++]
public: HRESULT MouseMove(
int Button,
int Shift,
long X,
long Y
);

Parameters

Button
An integer that corresponds to the state of the mouse buttons in which a bit is set if the button is down. The Button argument is a bit field with bits corresponding to the left button (bit 0), right button (bit 1), and middle button (bit 2). These bits correspond to the values 1, 2, and 4, respectively. It indicates the complete state of the mouse buttons; some, all, or none of these three bits can be set, indicating that some, all, or none of the buttons are pressed.
Shift
An integer that corresponds to the state of the SHIFT, CTRL, and ALT keys at the time of the event. The Shift argument is a bit field with the least-significant bits corresponding to the SHIFT key (bit 0), the CTRL key (bit 1), and the ALT key (bit 2). These bits correspond to the values 1, 2, and 4, respectively. Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed. For example, if both CTRL and ALT are pressed, the value of Shift is 6.
X
Returns a number that specifies the x-position of the current location of the mouse pointer. The x and y values are always expressed in terms of the control window coordinate system.
Y
Returns a number that specifies the y-position of the current location of the mouse pointer. The x and y values are always expressed in terms of the control window coordinate system.

Remarks

The MouseMove event is generated continually as the mouse pointer moves across the control.

If you need to test for the Button or Shift arguments, you can use constants available in AgEButtonValues and AgEShiftValues.

These constants act as bit masks you can use to test for any combination of buttons without having to figure out the unique bit field value for each combination.

Note   You can use MouseDown and MouseUp event procedures to respond to events caused by pressing and releasing mouse buttons.

The Button argument for MouseMove differs from the Button argument for MouseDown and MouseUp. For MouseMove, the Button argument indicates the current state of all buttons; a single MouseMove event can indicate that some, all, or no buttons are pressed. For MouseDown and MouseUp, the Button argument indicates exactly one button per event.

 

In VB.NET the MouseMove event is shown as  "xxxxxxxx_MouseMoveEvent" in the IDE.

Example

[Visual Basic .NET] Copy Code
Private Sub AxAgUiAxVOCntrl1_MouseMoveEvent( _
                    ByVal sender As Object, _
                    ByVal e As AxAGI.STKX.IAgUiAxVOCntrlEvents_MouseMoveEvent) _
        Handles AxAgUiAxVOCntrl1.MouseMoveEvent


    If (e.button = AGI.STKX.AgEButtonValues.eRightPressed) And _
       (e.shift = AGI.STKX.AgEShiftValues.eCtrlPressed) Then
        ' Mouse moved with right button pushed and CTRL key pressed
        ...
    End If

End Sub

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1