StylusButtons.GetName 方法
返回 StylusButtons 对象中给定索引处的手写笔按钮的名称。
命名空间: Microsoft.StylusInput
程序集: Microsoft.Ink(在 Microsoft.Ink.dll 中)
语法
声明
Public Function GetName ( _
index As Integer _
) As String
用法
Dim instance As StylusButtons
Dim index As Integer
Dim returnValue As String
returnValue = instance.GetName(index)
public string GetName(
int index
)
public:
String^ GetName(
int index
)
public String GetName(
int index
)
public function GetName(
index : int
) : String
参数
- index
类型:System.Int32
返回值
类型:System.String
返回手写笔按钮的名称。
备注
名称由数字化仪 的制造商定义。
该集合中提供的按钮列表指示数字化仪支持、但不一定出现在笔上的按钮。当插件收到 StylusButtonDown 和 StylusButtonUp 通知时,您可以确定特定手写笔按钮的状态,并确认其是否存在。
示例
此 Microsoft Visual C# .NET 示例演示在窗体上实现的 StylusButtonUp 方法的事件处理程序:
public class Form1 : Form, IStylusAsyncPlugin
{
private RealTimeStylus rts;
private DynamicRenderer dr;
private System.Windows.Forms.TextBox textBox1;
public Form1()
{
rts = new RealTimeStylus(this);
dr = new DynamicRenderer(this);
rts.SyncPluginCollection.Add(dr);
rts.AsyncPluginCollection.Add(this);
rts.Enabled = true;
dr.Enabled = true;
InitializeComponent();
}
// ...
public Microsoft.StylusInput.DataInterestMask DataInterest
{
get{return DataInterestMask.AllStylusData;}
}
public void StylusButtonUp(RealTimeStylus sender, StylusButtonUpData data)
{
textBox1.AppendText(
string.Format("{0} button up: {1} ({2}){3}",
data.Stylus.Name,
data.Stylus.Buttons.GetName(data.ButtonIndex),
data.ButtonIndex.ToString(),
Environment.NewLine)
);
}
// ...
平台
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.0
另请参见
参考
Microsoft.StylusInput.PluginData.StylusButtonDataBase