Share via


CursorButtonUp Event

CursorButtonUp Event

Occurs when the InkCollector detects a cursor button that is up.

Declaration

[C++]

void CursorButtonUp(
    [in] IInkCursor* Cursor,
    [in] IInkCursorButton* Button
);

[Microsoft® Visual Basic® 6.0]

Public Event CursorButtonUp( _
    Cursor As IInkCursor, _
    Button As IInkCursorButton _
)

Parameters

Cursor

[in] The IInkCursor object that generated the CursorButtonUp event.

Button

[in] The button that was released.

Remarks

A button on a pen tip is up when the user completes a stroke and lifts the pen from the digitizer. A button on a barrel is up when the button is not pressed.

When you release the right mouse button, you actually receive two CursorButtonUp events — one for right button up and one for left button up.

This event method is defined in the _IInkCollectorEvents, _IInkOverlayEvents, and _IInkPictureEvents dispinterfaces with an ID of DISPID_ICECursorButtonUp.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example demonstrates using event handlers to display the state of the cursor buttons and whether the cursor is in or out of range. This simple application has a text edit control, Text1, where messages appear when events are received.

Option Explicit
Dim WithEvents theInkCollector As InkCollector

Private Sub Form_Load()
    Set theInkCollector = New InkCollector
    theInkCollector.hWnd = Me.hWnd
    theInkCollector.Enabled = True

    theInkCollector.SetEventInterest ICEI_CursorButtonUp, True
    theInkCollector.SetEventInterest ICEI_CursorButtonDown, True
End Sub

Private Sub theInkCollector_CursorButtonUp( _
ByVal Cursor As MSINKAUTLib.IInkCursor, _
ByVal Button As MSINKAUTLib.IInkCursorButton)
    Text1.Text = _
    "Cursor " & Cursor.Name & "." & Button.Name & " button up"
End Sub

Private Sub theInkCollector_CursorButtonDown( _
ByVal Cursor As MSINKAUTLib.IInkCursor, _
ByVal Button As MSINKAUTLib.IInkCursorButton)
    Text1.Text = _
    "Cursor " & Cursor.Name & "." & Button.Name & " button down"
End Sub

Private Sub theInkCollector_CursorInRange( _
ByVal Cursor As MSINKAUTLib.IInkCursor, _
ByVal NewCursor As Boolean, _
ByVal ButtonsState As Variant)
    Text1.Text = _
    "Cursor " & Cursor.Name & " in range, NewCursor is " & NewCursor
End Sub

Private Sub theInkCollector_CursorOutOfRange( _
ByVal Cursor As MSINKAUTLib.IInkCursor)
    Text1.Text = "Cursor " & Cursor.Name & " out of range"
End Sub

Applies To