Compartilhar via


Tablet Property

Tablet Property

Gets either the IInkTablet object to which a cursor belongs or the IInkTablet object that an object or control is currently using to collect input.

Declaration

[C++]

[C++]
[propget] HRESULT get_Tablet([out,retval]IInkTablet** Tablet);

[Microsoft® Visual Basic® 6.0]

[Visual Basic]
Public Property Get Tablet() As InkTablet

Property Value

InkTablet Either the IInkTablet object to which a cursor belongs or the IInkTablet object that an object or control is currently using to collect input.

This property is read-only.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER The Tablet parameter is not a valid pointer to an IInkTablet object.
E_OUTOFMEMORY Cannot allocate memory to complete the operation.
E_FAIL An unspecified error occurs.
E_INK_EXCEPTION An exception occurs while processing.

Remarks

Note: For an object or control that collects ink, this property is valid only when the object or control is collecting ink from just one tablet. Accessing this property for an object or control that is collecting ink from all tablets generates an exception.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example returns a report on the properties of the IInkTablet object referenced by the InkOverlay object that is passed in as a parameter.

[Visual Basic]
Public Function OverlayTabletReport(ByVal theInkOverlay As InkOverlay)
    On Error Resume Next
    Dim theReport As String
    '
    ' accessing the tablet property of the InkOverlay might throw an exception if
    ' the overlay object is in all tablets mode.  We check Err.Number and use On Error Resume Next
    ' to handle this situation
    '
    Dim overlayTablet As IInkTablet
    Set overlayTablet = theInkOverlay.Tablet

    If (Err.Number = 0) Then
        theReport = "The tablet associated with this overlay has the following properties:" & vbCrLf
        theReport = theReport & "Tablet Name         = " _
            & overlayTablet.name & vbCrLf
        theReport = theReport & "Tablet PNP ID       = " _
            & overlayTablet.PlugAndPlayId & vbCrLf
        theReport = theReport & "Tablet Max Rect     = " _
            & overlayTablet.MaximumInputRectangle.ToString() & vbCrLf
        theReport = theReport & "Tablet Capabilities = " _
            & overlayTablet.HardwareCapabilities & vbCrLf
    Else
        theReport = "The InkOverlay is in all tablets mode." & vbCrLf
        theReport = theReport & "The tablet report cannot be generated." & vbCrLf
    End If
    OverlayTabletReport = theReport
End Function

Applies To