다음을 통해 공유


RealTimeStylus.GetStyluses 메서드

업데이트: 2007년 11월

RealTimeStylus에서 발견한 Stylus 개체의 배열을 반환합니다.

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

구문

‘선언
Public Function GetStyluses As Stylus()
‘사용 방법
Dim instance As RealTimeStylus
Dim returnValue As Stylus()

returnValue = instance.GetStyluses()
public Stylus[] GetStyluses()
public:
array<Stylus^>^ GetStyluses()
public Stylus[] GetStyluses()
public function GetStyluses() : Stylus[]

반환 값

형식: array<Microsoft.StylusInput.Stylus[]
RealTimeStylus 에서 발견한 Stylus 개체의 배열입니다.

설명

RealTimeStylus에 연결된 Tablet 개체에서 Stylus 개체가 아직 감지되지 않았으면 빈 배열이 반환됩니다.

RealTimeStylus가 비활성화되거나 삭제된 경우 이 메서드는 예외를 throw합니다.

예제

이 C# 예제는 메뉴 항목의 Click 이벤트 처리기에서 가져온 코드 조각입니다. 메뉴는 TextBox 개체인 theTextBox가 정의된 폼의 일부입니다. RealTimeStylus 개체가 비활성화되어 있으면 이벤트 처리기가 종료됩니다. 그렇지 않으면 이벤트 처리기에서 RealTimeStylus 개체의 GetStyluses 메서드를 호출하고 각 태블릿 펜에 대한 정보를 theTextBox에 표시합니다. 폼의 도우미 메서드인 StylusDataToString은 지정된 스타일러스에 대한 정보가 들어 있는 String 개체를 반환합니다.

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;

// ...

// The GetStyluses menu item's ClickEventHandler
private void theMenuItemGetStyluses_Click(object sender, System.EventArgs e)
{
    // Can not call this method while the RealTimeStylus is disabled.
    if (!this.thePrimaryRealTimeStylus.Enabled)
    {
        MessageBox.Show("The GetStyluses method of the RealTimeStylus can only be called while the RealTimeStylus is enabled.");
        return;
    }

    this.theTextBox.Text = "The Styluses encountered so far:" + Environment.NewLine;
    foreach (Stylus theStylus in this.thePrimaryRealTimeStylus.GetStyluses())
    {
        this.theTextBox.Text +=
            this.StylusDataToString(theStylus) + Environment.NewLine;
    }
}

플랫폼

Windows Vista, Windows XP SP2, Windows Server 2003

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

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

RealTimeStylus 클래스

RealTimeStylus 멤버

Microsoft.StylusInput 네임스페이스