次の方法で共有


Buttons Property

Buttons Property

Returns the IInkCursorButtons collection that is available on an IInkCursor.

Declaration

[C++]

[propget] HRESULT get_Buttons ([out, retval] InkCursorButtons** Buttons);

[Microsoft® Visual Basic® 6.0]

Public Property Get Buttons() As IInkCursorButtons

Property Value

InkCursorButtons The IInkCursorButtons collection that is available on the IInkCursor.

This property is read-only.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER The Buttons parameter must be a valid pointer to an InkCursorButtons pointer.
E_INKEXCEPTION An exception occurred while processing.
E_FAIL An unspecified error occurred.

Remarks

For a pen, the buttons may include the writing tip, the eraser end, and the barrel button.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example returns a report on the attributes of all of the cursors that were encountered 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