Stylus.TabletContextId 屬性
取得 Stylus 物件所屬手寫板裝置的內容識別項。
命名空間: Microsoft.StylusInput
組件: Microsoft.Ink (在 Microsoft.Ink.dll 中)
語法
'宣告
Public ReadOnly Property TabletContextId As Integer
'用途
Dim instance As Stylus
Dim value As Integer
value = instance.TabletContextId
public int TabletContextId { get; }
public:
property int TabletContextId {
int get ();
}
/** @property */
public int get_TabletContextId()
public function get TabletContextId () : int
屬性值
型別:System.Int32
Stylus 物件所屬手寫板裝置的內容識別項。
備註
這個識別項是 Stylus 物件所屬之 RealTimeStylus 物件專有。
範例
這個 Microsoft Visual C# .NET 範例是來自表單之 Helper 方法 StylusDataToString 的程式碼片段。Helper 方法會採用 Stylus 物件,並且傳回包含手寫筆及其按鈕資訊的字串。
using Microsoft.Ink;
using Microsoft.StylusInput;
using Microsoft.StylusInput.PluginData;
// ...
// Declare the RealTimeStylus objects, the GestureRecognizer plugin,
// and the DynamicRenderer plug-in.
private Microsoft.StylusInput.RealTimeStylus thePrimaryRealTimeStylus = null;
private Microsoft.StylusInput.RealTimeStylus theSecondaryRealTimeStylus = null;
private Microsoft.StylusInput.GestureRecognizer theGestureRecognizer = null;
private Microsoft.StylusInput.DynamicRenderer theDynamicRenderer = null;
// ...
// Returns information about a given stylus.
private string StylusDataToString(Stylus theStylus)
{
System.Text.StringBuilder result = new System.Text.StringBuilder();
// Add information about the tablet pen.
result.Append(
string.Format(" Name = {0}, Id = {1}, ContextId = {2}, Inverted = {3}, Button Count = {4}."
+ Environment.NewLine, theStylus.Name, theStylus.Id,
theStylus.TabletContextId, theStylus.Inverted, theStylus.Buttons.Count));
// Add information about each of the tabet pen's buttons.
for (int i=0; i<theStylus.Buttons.Count; i++)
{
result.Append(
string.Format(" Button {0}: Name = {1}, Id = {2}" + Environment.NewLine,
i, theStylus.Buttons.GetName(i), theStylus.Buttons.GetId(i)));
}
return result.ToString();
}
平台
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0
請參閱
參考
Microsoft.StylusInput.PluginData.StylusButtonDataBase