Bagikan melalui


InkOverlay.Tablet Property

Gets the tablet device that the InkOverlay object is currently using to collect input.

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

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Tablet As Tablet
'Usage
Dim instance As InkOverlay 
Dim value As Tablet 

value = instance.Tablet
[BrowsableAttribute(false)]
public Tablet Tablet { get; }
[BrowsableAttribute(false)]
public:
property Tablet^ Tablet {
    Tablet^ get ();
}
public function get Tablet () : Tablet

Property Value

Type: Microsoft.Ink.Tablet
The tablet device that the InkOverlay object is currently using to collect input.

Remarks

Note

This property is valid only when the InkOverlay is collecting ink from just one tablet. Accessing this property for an InkOverlay that is collecting ink from more than one tablet generates an exception.

Examples

This example returns a report on the properties of the Tablet object referenced by the InkOverlay object, mInkObject.

Public Function InkObjectTabletReport() As String 
    Dim Result As StringBuilder = New StringBuilder(512)
    ' Wrap access to the Tablet object in a try/catch block.  
    ' If mInkObject is in All Tablets mode, an exception will be  
    ' thrown when accessing the Tablet property. 
    Try
        Result.AppendLine("The tablet associated mInkObject has the following properties:")
        ' accessing mInkObject.Tablet will throw an exception if in All Tablets mode 
        ' mInkObject can be InkCollector, InkOverlay, or InkPicture 
        Dim mTablet As Tablet = mInkObject.Tablet
        Result.AppendLine("Tablet Name: " + mTablet.Name)
        Result.AppendLine("Tablet PNP ID: " + mTablet.PlugAndPlayId)
        Result.AppendLine("Tablet Max Rect: " + mTablet.MaximumInputRectangle.ToString())
        Result.AppendLine("Tablet Capabilities: " + mTablet.HardwareCapabilities)

    Catch ex As System.Exception
        Result.AppendLine("mInkObject is in all tablets mode.")
        Result.AppendLine("The tablet report cannot be generated.")
    End Try 

    Return Result.ToString()
End Function
public string InkObjectTabletReport()
{
    StringBuilder Result = new StringBuilder(512);

    // Wrap access to the Tablet object in a try/catch block.  
    // If mInkObject is in All Tablets mode, an exception will be  
    // thrown when accessing the Tablet property. 
    try
    {
        Result.AppendLine("The  tablet associated with mInkObject has the following properties:");
        // accessing mInkObject.Tablet will throw an exception if in All Tablets mode 
        // mInkObject can be InkCollector, InkOverlay, or InkPicture
        Tablet mTablet = mInkObject.Tablet;
        Result.AppendLine("Tablet Name: " + mTablet.Name);
        Result.AppendLine("Tablet PNP ID: " + mTablet.PlugAndPlayId);
        Result.AppendLine("Tablet Max Rect: " + mTablet.MaximumInputRectangle.ToString());
        Result.AppendLine("Tablet Capabilities: " + mTablet.HardwareCapabilities);
    }
    catch (System.Exception)
    {
        Result.AppendLine("mInkObject is in all tablets mode.");
        Result.AppendLine("The tablet report cannot be generated.");
    }

    return Result.ToString();
}

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkOverlay Class

InkOverlay Members

Microsoft.Ink Namespace

Tablet

InkOverlay.SetAllTabletsMode

InkOverlay.SetSingleTabletIntegratedMode