PlotMouseDown, PlotMouseMove, PlotMouseUp Events

Measurement Studio User Interface

PlotMouseDown, PlotMouseMove, PlotMouseUp Events

Syntax

Sub ControlName_PlotMouseDown( Button As Integer, Shift As Integer, XData As Variant, YData As Variant, PlotIndex As Integer, PointIndex As Long)

Sub ControlName_PlotMouseMove( Button As Integer, Shift As Integer, XData As Variant, YData As Variant, PlotIndex As Integer, PointIndex As Long)

Sub ControlName_PlotMouseUp( Button As Integer, Shift As Integer, XData As Variant, YData As Variant, PlotIndex As Integer, PointIndex As Long)

Applies To

CWGraph

Purpose

PlotMouseDown generates when you click the mouse on a plot.

PlotMouseMove generates when you move the mouse over a plot.

PlotMouseUp generates when you release the mouse over a plot.

Remarks

These events generate only if CWGraph.TrackMode is set to cwGTrackAllEvents.

In Visual Basic, use the following constants with the Button and Shift parameters:

vbLeftButton1Left button is pressed
vbRightButton2Right button is pressed
vbMiddleButton4Middle button is pressed
vbShiftMask1 <Shift> key is pressed
vbCtrlMask2 <Ctrl> key is pressed
vbAltMask4 <Alt> key is pressed

Parameters

Button As Integer

State of the mouse buttons. The Button argument can be any combination of the following values: 1 for the left button, 2 for the right button, or 4 for the middle button. For example, if both the left and right mouse buttons are pressed, the Button argument is 3 (1 + 2). In the PlotMouseUp event, the Button argument corresponds to the state of the buttons after the triggering button is released.

Shift As Integer

State of the <SHIFT> , <CTRL> , and <ALT> keys when the button specified in the Button argument is pressed, released, or moved. 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 ). Some, all, or none of the bits can be set, indicating that some, all, or none of the keys are pressed.

XData As Variant

The X value of the point nearest to the mouse pointer when the event occurred.

YData As Variant

The Y value of the point nearest to the mouse pointer when the event occurred.

PlotIndex As Integer

The index of the plot (zero-based).

PointIndex As Long

The index of the point (zero-based).

See Also

Plots