Condividi tramite


Proprietà InkCollector.Cursors

Aggiornamento: novembre 2007

Ottiene l'insieme Cursors disponibile per l'utilizzo nell'area dell'input penna.

Spazio dei nomi:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Sintassi

'Dichiarazione
Public ReadOnly Property Cursors As Cursors
'Utilizzo
Dim instance As InkCollector
Dim value As Cursors

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

Valore proprietà

Tipo: Microsoft.Ink.Cursors
Insieme Cursors disponibile per l'utilizzo nell'area dell'input penna.

Note

Ogni cursore corrisponde alla punta di una penna o di un altro dispositivo di input penna.

In questo insieme sono presenti cursori locali di un oggetto InkCollector.

Tutti i nuovi cursori rilevati dall'oggetto InkCollector vengono aggiunti all'insieme Cursors restituito, sebbene non vengano restituiti necessariamente nell'ordine in cui l'oggetto InkCollector li rileva.

Quando si attiva un mouse come dispositivo di input sull'oggetto InkCollector (se il parametro useMouseForInput del metodo SetAllTabletsMode è impostato su true), il mouse viene aggiunto all'insieme Cursors dopo che l'oggetto InkCollector ha rilevato qualsiasi altro cursore, ad esempio una penna. Ciò è dovuto al fatto che la penna ha un comportamento analogo a quello di un mouse.

Nota

L'evento CursorInRange relativo al cursore del mouse viene ricevuto dopo quello di qualsiasi altro cursore, ad esempio una penna che disegna un tratto (generando l'evento Stroke ).

L'insieme Cursors viene cancellato (conteggio impostato su 0, se non è presente alcun oggetto) quando:

Esempi

In questo esempio di C# viene restituito un report sugli attributi di tutti i cursori riscontrati dall'oggetto InkCollector passato come parametro.

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

In questo esempio di Microsoft Visual Basic .NET viene restituito un report sugli attributi di tutti i cursori rilevati dall'oggetto InkCollector passato come parametro.

Imports Microsoft.Ink
'. . .
Public Function CursorReport(ByVal theInkCollector As InkCollector) _
    As String
    Dim theReport As String = "The InkCollector has encountered " & _
        "the following cursors so far:" & vbCrLf
    ' Get the Cursors collection from the InkCollector
    Dim theCursors As Cursors = theInkCollector.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

Piattaforme

Windows Vista

.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.

Informazioni sulla versione

.NET Framework

Supportato in: 3.0

Vedere anche

Riferimenti

InkCollector Classe

Membri InkCollector

Spazio dei nomi Microsoft.Ink

Cursors

Cursor

InkCollector.SetSingleTabletIntegratedMode

InkCollector.SetAllTabletsMode