Tablets.DefaultTablet Property

Tablets.DefaultTablet Property

Gets the default Tablet object of the Tablets collection.

Definition

Visual Basic .NET Public ReadOnly Property DefaultTablet As Tablet
C# public Tablet DefaultTablet { get; }
Managed C++ public: __property Tablet* get_DefaultTablet();

Property Value

Microsoft.Ink.Tablet. The default Tablet object of the Tablets collection.

This property is read-only. This property has no default value.

Remarks

The platform determines the default Tablet object in the following order:

  1. If the system has a digitizer integrated with the display device, this integrated digitizer is considered the default tablet, even if other digitizing tablets are installed.
  2. If more than one digitizing tablet is installed in the system, the first one encountered during initialization is considered the default tablet.
  3. If only one digitizing tablet is installed in the system, it is considered the default tablet.
  4. If no digitizing tablets are installed in the system but there are other pointing devices (such as a mouse or a touch pad) installed that generate mouse messages, those devices in aggregate are considered to be the default tablet.

If no digitizing tablets and no pointing devices are installed in the system, an exception is thrown.

Examples

[C#]

This C# example returns a string that contains a report on the Tablets collection, theTablets, including the count of tablets, the name of the default tablet, and the tablets' supported properties.

using System.Text;  // For StringBuilder support
using Microsoft.Ink;
// . . .
public string ReportOnTablets()
{
    Tablets theTablets = new Tablets();
    StringBuilder theReport = new StringBuilder();
    theReport.Append("Ink reports the following tablet hardware:" + Environment.NewLine);
    theReport.Append("Count of available tablets: " + theTablets.Count + "" + Environment.NewLine);
    theReport.Append("Default tablet name: " + theTablets.DefaultTablet.Name + "" + Environment.NewLine);
    theReport.Append("Tablets IsPacketPropertySupported: " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.AltitudeOrientation))
        theReport.Append("    AltitudeOrientation " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.AzimuthOrientation))
        theReport.Append("    AzimuthOrientation " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.ButtonPressure))
        theReport.Append("    ButtonPressure " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.NormalPressure))
        theReport.Append("    NormalPressure " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.PacketStatus))
        theReport.Append("    PacketStatus " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.PitchRotation))
        theReport.Append("    PitchRotation " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.RollRotation))
        theReport.Append("    RollRotation " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.SerialNumber))
        theReport.Append("    SerialNumber " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.TangentPressure))
        theReport.Append("    TangentPressure " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.TimerTick))
        theReport.Append("    TimerTick " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.TwistOrientation))
        theReport.Append("    TwistOrientation " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.X))
        theReport.Append("    X " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.XTiltOrientation))
        theReport.Append("    XTiltOrientation " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.Y))
        theReport.Append("    Y " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.YawRotation))
        theReport.Append("    YawRotation " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.YTiltOrientation))
        theReport.Append("    YTiltOrientation " + Environment.NewLine);
    if (theTablets.IsPacketPropertySupported(PacketProperty.Z))
        theReport.Append("    Z " + Environment.NewLine);
    return theReport.ToString();
}

[Visual Basic .NET]

This Microsoft® Visual Basic® .NET example returns a string that contains a report on the Tablets collection, theTablets, including the count of tablets, the name of the default tablet, and the tablets' supported properties.

Imports Microsoft.Ink
'...
Public Function ReportOnTablets() As String
    Dim theTablets As Tablets = New Tablets()
    Dim theReport As String
    theReport &= "Ink reports the following tablet hardware:" & vbCrLf
    theReport &= "Count of available tablets: " & theTablets.Count & _
        vbCrLf
    theReport &= "Default tablet name: " & _
        theTablets.DefaultTablet.Name & vbCrLf
    theReport &= "Tablets IsPacketPropertySupported:" & vbCrLf
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.AltitudeOrientation) Then
        theReport &= "    AltitudeOrientation" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.AzimuthOrientation) Then
        theReport &= "    AzimuthOrientation" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.ButtonPressure) Then
        theReport &= "    ButtonPressure" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.NormalPressure) Then
        theReport &= "    NormalPressure" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.PacketStatus) Then
        theReport &= "    PacketStatus" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.PitchRotation) Then
        theReport &= "    PitchRotation" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.RollRotation) Then
        theReport &= "    RollRotation" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.SerialNumber) Then
        theReport &= "    SerialNumber" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.TangentPressure) Then
        theReport &= "    TangentPressure" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.TimerTick) Then
        theReport &= "    TimerTick" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.TwistOrientation) Then
        theReport &= "    TwistOrientation" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.X) Then
        theReport &= "    X" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.XTiltOrientation) Then
        theReport &= "    XTiltOrientation" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.Y) Then
        theReport &= "    Y" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.YawRotation) Then
        theReport &= "    YawRotation" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.YTiltOrientation) Then
        theReport &= "    YTiltOrientation" & vbCrLf
    End If
    If theTablets.IsPacketPropertySupported( _
        PacketProperty.Z) Then
        theReport &= "    Z" & vbCrLf
    End If
    Return theReport
End Function

See Also