共用方式為


Tablet.PlugAndPlayId 屬性

取得 Tablet 物件的隨插即用識別項的字串表示。

命名空間:  Microsoft.Ink
組件:  Microsoft.Ink (在 Microsoft.Ink.dll 中)

語法

'宣告
Public ReadOnly Property PlugAndPlayId As String
'用途
Dim instance As Tablet
Dim value As String

value = instance.PlugAndPlayId
public string PlugAndPlayId { get; }
public:
property String^ PlugAndPlayId {
    String^ get ();
}
/** @property */
public String get_PlugAndPlayId()
public function get PlugAndPlayId () : String

屬性值

型別:System.String
Tablet 物件的隨插即用識別項。

備註

傳回值取決於 HIDD_ATTRIBUTES.ProductID (英文) 項目。手寫板裝置的製造商負責加入這個字串。如果手寫板裝置沒有識別項,則傳回值是空的。

ms582602.alert_note(zh-tw,VS.90).gif注意事項:

如果在特定訊息處理常式內呼叫的話,可能會重新輸入這個函式,造成非預期的結果。處理下列訊息時,請小心避免使用可重新進入的呼叫:WM_ACTIVATEWM_ACTIVATEAPPWM_NCACTIVATEWM_PAINTWM_SYSCOMMAND (如果 wParam 設定為 SC_HOTKEY 或 SC_TASKLIST) 和 WM_SYSKEYDOWN (處理 ALT+TAB 或 ALT+ESC 組合鍵時)。不過在單一執行緒 Apartment Model (STA) 應用程式中會發生問題。

範例

這個範例會報告隨插即用 ID、硬體功能,以及 Tablets 集合中預設 Tablet 物件的最大輸入矩形。

Public Function Report_Hardware_DefaultTablet() As String
    Dim SB As StringBuilder = New StringBuilder(1024)
    Dim defTablet As Tablet = New Tablets().DefaultTablet

    ' report on the hardware capabilities of the default tablet
    SB.AppendLine("Hardware capabilities of the default tablet: " + defTablet.Name)
    SB.AppendLine("PlugAndPlayId: " + defTablet.PlugAndPlayId)

    If (defTablet.HardwareCapabilities And TabletHardwareCapabilities.CursorMustTouch) <> 0 Then
        SB.AppendLine("CursorMustTouch: YES")
    Else
        SB.AppendLine("CursorMustTouch: NO")
    End If

    If (defTablet.HardwareCapabilities And TabletHardwareCapabilities.CursorsHavePhysicalIds) <> 0 Then
        SB.AppendLine("CursorsHavePhysicalIds: YES")
    Else
        SB.AppendLine("CursorsHavePhysicalIds: NO")
    End If

    If (defTablet.HardwareCapabilities And TabletHardwareCapabilities.HardProximity) <> 0 Then
        SB.AppendLine("HardProximity:: YES")
    Else
        SB.AppendLine("HardProximity:: NO")
    End If

    If (defTablet.HardwareCapabilities And TabletHardwareCapabilities.Integrated) <> 0 Then
        SB.AppendLine("Integrated: YES")
    Else
        SB.AppendLine("Integrated: NO")
    End If

    SB.AppendLine("MaximumInputRectangle " + defTablet.MaximumInputRectangle.ToString())

    Return SB.ToString()
End Function
public string Report_Hardware_DefaultTablet()
{
    StringBuilder SB = new StringBuilder(1024);
    Tablet defTablet = new Tablets().DefaultTablet;

    // report on the hardware capabilities of the default tablet
    SB.AppendLine("Hardware capabilities of the default tablet: " + defTablet.Name);
    SB.AppendLine("PlugAndPlayId: " + defTablet.PlugAndPlayId);

    SB.AppendLine("CursorMustTouch: " +
        (((defTablet.HardwareCapabilities & TabletHardwareCapabilities.CursorMustTouch) != 0) ? "YES" : "NO"));

    SB.AppendLine("CursorsHavePhysicalIds: " +
        (((defTablet.HardwareCapabilities & TabletHardwareCapabilities.CursorsHavePhysicalIds) != 0) ? "YES" : "NO"));

    SB.AppendLine("HardProximity: " +
        (((defTablet.HardwareCapabilities & TabletHardwareCapabilities.HardProximity) != 0) ? "YES" : "NO"));

    SB.AppendLine("Integrated: " +
        (((defTablet.HardwareCapabilities & TabletHardwareCapabilities.Integrated) != 0) ? "YES" : "NO"));

    SB.AppendLine("MaximumInputRectangle " + defTablet.MaximumInputRectangle.ToString());

    return SB.ToString();
}

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

Tablet 類別

Tablet 成員

Microsoft.Ink 命名空間