Compartir a través de


InkPicture.Tablet Property

Gets the tablet device that the InkPicture control is currently using to collect input.

Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in microsoft.ink.dll)

Syntax

'Declaration
Public ReadOnly Property Tablet As Tablet
'Usage
Dim instance As InkPicture
Dim value As Tablet

value = instance.Tablet
public Tablet Tablet { get; }
public:
property Tablet^ Tablet {
    Tablet^ get ();
}
/** @property */
public Tablet get_Tablet ()
public function get Tablet () : Tablet
Not applicable.

Property Value

The tablet device that the InkPicture control is currently using to collect input.

Remarks

Note

This property is valid only when the InkPicture control is collecting ink from just one tablet. Accessing this property for an InkPicture that is collecting ink from all tablets generates an exception.

Example

This C# example returns a report on the properties of the Tablet object referenced by the InkPicture control, theInkPicture, that is passed in as a parameter.

[C#]

using Microsoft.Ink;
//. . .
public string InkPictureTabletReport(InkPicture theInkPicture)
{
    string theReport = "";

    //
    // We wrap access to the Tablet object in a try / catch block here because the InkPicture might
    // be in all tablets mode.  If it is, and we try to access the Tablet property, an exception will be
    // thrown.
    //
    try
    {
        theReport = "The tablet associated with this InkPicture has the following properties:" + Environment.NewLine;
        Microsoft.Ink.Tablet pictureTablet = theInkPicture.Tablet;
 
        theReport += "Tablet Name         = " + pictureTablet.Name + Environment.NewLine;
        theReport += "Tablet PNP ID       = " + pictureTablet.PlugAndPlayId + Environment.NewLine;
        theReport += "Tablet Max Rect     = " + pictureTablet.MaximumInputRectangle.ToString() +
                      Environment.NewLine;
        theReport += "Tablet Capabilities = " + pictureTablet.HardwareCapabilities + Environment.NewLine;
    }
    catch (System.Exception)
    {
        theReport = "The InkPicture is in all tablets mode." + Environment.NewLine;
        theReport += "The tablet report cannot be generated." + Environment.NewLine;
    }

    return theReport;
//...

This Microsoft® Visual Basic® .NET example returns a report on the properties of the Tablet object referenced by the InkPicture control, theInkPicture, that is passed in as a parameter.

[Visual Basic]

Imports Microsoft.Ink
'. . .
Public Function InkPictureTabletReport(ByVal theInkPicture As InkPicture)
    On Error Resume Next
    Dim theReport As String

    '
    ' Accessing the tablet property of the InkPicture might throw an exception if
    ' the Picture control is in all tablets mode.  We check Err.Number and use On Error Resume Next
    ' to handle this situation
    '
    Dim pictureTablet As Tablet = theInkPicture.Tablet
    If (Err.Number = 0) Then

        theReport = "The tablet associated with this InkPicture has the following properties:" & vbCrLf

        theReport &= "Tablet Name         = " & pictureTablet.Name & vbCrLf
        theReport &= "Tablet PNP ID       = " & pictureTablet.PlugAndPlayId & vbCrLf
        theReport &= "Tablet Max Rect     = " & pictureTablet.MaximumInputRectangle.ToString() & vbCrLf
        theReport &= "Tablet Capabilities = " & pictureTablet.HardwareCapabilities & vbCrLf
    Else
        theReport = "The InkPicture is in all tablets mode." & vbCrLf
        theReport &= "The tablet report cannot be generated." & vbCrLf
    End If

    Return theReport
End Function

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkPicture Class
InkPicture Members
Microsoft.Ink Namespace
Tablet
Microsoft.Ink.InkPicture.SetAllTabletsMode
InkPicture.SetSingleTabletIntegratedMode