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


InkPicture.Cursors - свойство

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

Gets the Cursors collection that is available for use in the inking region.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
<BrowsableAttribute(False)> _
Public ReadOnly Property Cursors As Cursors
'Применение
Dim instance As InkPicture
Dim value As Cursors

value = instance.Cursors
[BrowsableAttribute(false)]
public Cursors Cursors { get; }
[BrowsableAttribute(false)]
public:
property Cursors^ Cursors {
    Cursors^ get ();
}
/** @property */
/** @attribute BrowsableAttribute(false) */
public Cursors get_Cursors()
public function get Cursors () : Cursors

Значение свойства

Тип: Microsoft.Ink.Cursors
The Cursors collection that is available for use in the inking region.

Заметки

Each cursor corresponds to the tip of a pen or other ink input device.

The cursors in this collection are local to an InkPicture control.

Any new cursors that the InkPicture control encounters are added to the returned Cursors collection, although the cursors are not necessarily returned in the order in which the InkPicture control encounters them.

When you enable a mouse as an input device on the InkPicture control (when the useMouseForInput parameter of the SetAllTabletsMode method is true), the mouse is added to the Cursors collection after the InkPicture encounters any other cursor, such as a pen. This is because the pen also acts like a mouse.

ms582184.alert_note(ru-ru,VS.90).gifПримечание.

The CursorInRange event is received for the mouse cursor after any other cursor, such as when a pen draws a stroke (which fires the Stroke event).

The Cursors collection is cleared (count set to 0, containing no objects) when:

Примеры

This C# example returns a report on the attributes of all of the cursors seen by the InkPicture control passed in the parameter, theInkPicture.

[C#]

using Microsoft.Ink;
//. . .
public string CursorReport(InkPicture theInkPicture)
{
    string theReport = "The InkPicture has encountered the following cursors so far:" + Enivironment.NewLine;
    // Get the Cursors collection from the InkPicture
    Cursors theCursors = theInkPicture.Cursors;
    // Prevent changes to the collection while we iterate over it.
    lock(theCursors.SyncRoot )
    {
        theReport += "Count of cursors: " + theCursors.Count + Enivironment.NewLine + Enivironment.NewLine;
        foreach (Cursor cursor in theCursors)
        {
            theReport += "Cursor Name: " + cursor.Name + Enivironment.NewLine;
            theReport += "Cursor ToString: " + cursor.ToString() + Enivironment.NewLine;
            theReport += "Tablet Name: " + cursor.Tablet.Name + Enivironment.NewLine;
            theReport += "Cursor Id: " + cursor.Id.ToString() + Enivironment.NewLine;
            theReport += "Cursor is inverted: " + cursor.Inverted.ToString() + Enivironment.NewLine;
            theReport += "Cursor Buttons:" + Enivironment.NewLine;
            foreach (CursorButton button in cursor.Buttons)
            {
                CursorButtonState theState = button.State;
                theReport += "    Button Name: " + button.Name + Enivironment.NewLine;
                theReport += "    State: " + button.State.ToString() + Enivironment.NewLine;
                theReport += "    Id: " + button.Id.ToString() + Enivironment.NewLine + Enivironment.NewLine;
            }
        }
    }
    return theReport;
}

This Microsoft® Visual Basic® .NET example returns a report on the attributes of all of the cursors seen by the InkPicture control passed in the parameter, theInkPicture.

[Visual Basic]

Imports Microsoft.Ink
'. . .
Public Function CursorReport(ByVal theInkPicture As InkPicture) _
    As String
    Dim theReport As String = "The InkPicture has encountered " & _
        "the following cursors so far:" & vbCrLf
    ' Get the Cursors collection from the InkPicture
    Dim theCursors As Cursors = theInkPicture.Cursors
    ' Prevent changes to the collection while we iterate over it.
    SyncLock theCursors.SyncRoot
        theReport &= "Count of cursors: " & theCursors.Count & vbCrLf
        Dim theCursor As Cursor
        For Each theCursor In theCursors
            theReport &= "Cursor Name: " & theCursor.Name & vbCrLf
            theReport &= "Cursor ToString: " & theCursor.ToString() & _
                vbCrLf
            theReport &= "Tablet Name: " & theCursor.Tablet.Name & vbCrLf
            theReport &= "Cursor Id: " & theCursor.Id.ToString() & vbCrLf
            theReport &= "Cursor is inverted: " & _
                theCursor.Inverted.ToString() & vbCrLf
            theReport &= "Cursor Buttons:" & vbCrLf
            Dim theButton As CursorButton
            For Each theButton In theCursor.Buttons
                Dim theState As CursorButtonState = theButton.State
                theReport &= "    Button Name: " & theButton.Name & vbCrLf
                theReport &= "    State: " & _
                    theButton.State.ToString() & vbCrLf
                theReport &= "    Id: " & theButton.Id.ToString() & _
                    vbCrLf & vbCrLf
            Next
        Next
    End SyncLock
    Return theReport
End Function

Платформы

Windows Vista

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

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

.NET Framework

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

См. также

Ссылки

InkPicture Класс

InkPicture - члены

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

InkPicture

Cursors

InkPicture.SetAllTabletsMode

InkPicture.SetSingleTabletIntegratedMode