次の方法で共有


Stylus.Buttons プロパティ

Stylus オブジェクトで使用可能な StylusButtons オブジェクトを取得します。

名前空間 :  Microsoft.StylusInput
アセンブリ :  Microsoft.Ink (Microsoft.Ink.dll 内)

構文

'宣言
Public ReadOnly Property Buttons As StylusButtons
'使用
Dim instance As Stylus
Dim value As StylusButtons

value = instance.Buttons
public StylusButtons Buttons { get; }
public:
property StylusButtons^ Buttons {
    StylusButtons^ get ();
}
/** @property */
public StylusButtons get_Buttons()
public function get Buttons () : StylusButtons

プロパティ値

型 : Microsoft.StylusInput.StylusButtons
Stylus オブジェクトで使用可能な StylusButtons オブジェクト。

解説

StylusButtons オブジェクトで示されるボタンには、ペン先、消しゴムの先端、胴体ボタンなどがあります。

この Microsoft Visual C# .NET の例は、フォームのヘルパ メソッドである StylusDataToString のスニペットです。ヘルパ メソッドは Stylus オブジェクトを受け取り、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

参照

参照

Stylus クラス

Stylus メンバ

Microsoft.StylusInput 名前空間

StylusButtons

Microsoft.StylusInput.PluginData.StylusButtonDataBase

Microsoft.StylusInput.PluginData.StylusButtonDownData

Microsoft.StylusInput.PluginData.StylusButtonUpData