다음을 통해 공유


StylusButtons.Count 속성

업데이트: 2007년 11월

스타일러스에 있는 단추 수를 가져옵니다.

네임스페이스:  Microsoft.StylusInput
어셈블리:  Microsoft.Ink(Microsoft.Ink.dll)

구문

‘선언
Public ReadOnly Property Count As Integer
‘사용 방법
Dim instance As StylusButtons
Dim value As Integer

value = instance.Count
public int Count { get; }
public:
property int Count {
    int get ();
}
/** @property */
public int get_Count()
public function get Count () : int

속성 값

형식: System.Int32
스타일러스에 있는 단추 수입니다.

설명

이 컬렉션에 제공된 단추 목록은 디지타이저에서 지원되는 단추를 나타내며, 펜에는 이러한 단추가 없을 수도 있습니다. 플러그 인에서 StylusButtonDownStylusButtonUp 알림을 받을 때 특정 스타일러스 단추의 상태를 판단하고 존재 여부를 확인할 수 있습니다.

예제

이 Microsoft Visual C# .NET 예제에서는 폼에 구현된 StylusInRange 메서드에 대한 이벤트 처리기를 보여 줍니다.

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 StylusInRange(RealTimeStylus sender, StylusInRangeData data)
    {
        string sInverted = data.Stylus.Inverted ? "is inverted" : "is not inverted";
        
        textBox1.AppendText(
            string.Format("{0} in range; {1}; has {2} buttons:{3}", 
                data.Stylus.Name, 
                sInverted,
                data.Stylus.Buttons.Count,
                Environment.NewLine)
            );

        for (int i=0; i<data.Stylus.Buttons.Count; i++)
        {
            textBox1.AppendText(
                string.Format("    {0}: {1}{2}", 
                    i.ToString(),
                    data.Stylus.Buttons.GetName(i),
                    Environment.NewLine)
                );
        }
    }
    // ...

플랫폼

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

StylusButtons 클래스

StylusButtons 멤버

Microsoft.StylusInput 네임스페이스

Microsoft.StylusInput.PluginData.StylusButtonDataBase

Microsoft.StylusInput.PluginData.StylusButtonDownData

Microsoft.StylusInput.PluginData.StylusButtonUpData