Поделиться через


RealTimeStylus.GetStyluses - метод

Обновлен: Ноябрь 2007

Returns the array of Stylus objects encountered by the RealTimeStylus.

Пространство имен:  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[]
The array of Stylus objects encountered by the RealTimeStylus.

Заметки

If no Stylus object has yet been detected on the Tablet objects associated with the RealTimeStylus, then this method returns an empty array.

This method throws an exception when the RealTimeStylus is disabled or disposed.

Примеры

This C# example is a snippet from a menu item's Click event handler. The menu is part of a form on which a TextBox object, theTextBox, is defined. If the RealTimeStylus object is disabled, the event handler exits. Otherwise, the event handler calls the RealTimeStylus object's GetStyluses method and displays information about each tablet pen in theTextBox. The form's helper method, StylusDataToString, returns a String object containing information about a given 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;

// ...

// 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 с пакетом обновления 2 (SP2), Windows Server 2003

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

RealTimeStylus Класс

RealTimeStylus - члены

Microsoft.StylusInput - пространство имен