Cursors Property

Cursors Property

Returns the collection of cursors that are available for use in the inking region. Each cursor corresponds to the tip of a pen or other ink input device.

Declaration

[C++]

[propget] HRESULT get_Cursors ([out, retval] IInkCursors** Cursors);

[Microsoft® Visual Basic® 6.0]

Public Property Get Cursors() As IInkCursors

Property Value

IInkCursors This property returns the collection of cursors that this InkCollector has encountered.

This property is read-only.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER The Cursors parameter must be a valid pointer to an IInkCursors pointer.
E_FAIL An unspecified error occurred.
E_INK_EXCEPTION An exception occurred inside the method.

Remarks

Cursors are local to an InkCollector object.

Any new cursors that the InkCollector encounters are added to the returned collection of cursors, although the returned cursors are not necessarily returned in the order in which the InkCollector encounters them.

When a mouse is enabled as an input device on the InkCollector (when the useMouse parameter of the SetAllTabletsMode method is TRUE), the mouse is added to the IInkCursors collection after the InkCollector encounters any other cursor, such as a pen. This is because the pen also acts like a mouse.

Note: The CursorInRange event is received for the mouse cursor after any other cursor, such as a pen, draws a stroke (which fires the Stroke event).

The IInkCursors collection is reset (count set to 0, containing no objects) when:

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example returns a report on the attributes of all of the cursors seen by the InkCollector object passed in as a parameter.

Public Function CursorReport(ByVal theInkCollector As InkCollector) _
    As String
    Dim theReport As String
    theReport = "The InkCollector has encountered " & _
        "the following cursors so far:" & vbCrLf
    ' Get the Cursors collection from the InkCollector
    Dim theCursors As IInkCursors
    Set theCursors = theInkCollector.Cursors
    theReport = _
        theReport & "Count of cursors: " & theCursors.Count & vbCrLf
    Dim theCursor As IInkCursor   For Each theCursor In theCursors
        theReport = theReport & "Cursor Name: " & theCursor.Name & vbCrLf
        theReport = _
            theReport & "Tablet Name: " & theCursor.Tablet.Name & vbCrLf
        theReport = theReport & "Cursor Id: " & theCursor.Id & vbCrLf
        theReport = theReport & "Cursor is inverted: " & _
            theCursor.Inverted & vbCrLf
        theReport = theReport & "Cursor Buttons:" & vbCrLf
        Dim theButton As IInkCursorButton
        For Each theButton In theCursor.Buttons
            Dim theState As InkCursorButtonState
                theState = theButton.State
            theReport = _
                theReport & "    Button Name: " & theButton.Name & vbCrLf
            theReport = theReport & "    State: " & _
                theButton.State & vbCrLf
            theReport = theReport & "    Id: " & theButton.Id & _
                vbCrLf & vbCrLf
        Next
    Next
    CursorReport = theReport
End Function

Applies To