Condividi tramite


Proprietà InkPicture.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
<BrowsableAttribute(False)> _
Public ReadOnly Property Cursors As Cursors
'Utilizzo
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

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 controllo InkPicture.

Tutti i nuovi cursori rilevati dal controllo InkPicture vengono aggiunti all'insieme Cursors restituito, sebbene non vengano restituiti necessariamente nell'ordine in cui il controllo InkPicture li rileva.

Quando si attiva un mouse come dispositivo di input sul controllo InkPicture (se il parametro useMouseForInput del metodo SetAllTabletsMode è impostato su true), il mouse viene aggiunto all'insieme Cursors dopo che l'oggetto InkPicture 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 dal controllo InkPicture passato nel parametro, 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;
}

In questo esempio di Microsoft® Visual Basic® .NET viene restituito un report sugli attributi di tutti i cursori rilevati dal controllo InkPicture passato nel parametro, 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

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

InkPicture Classe

Membri InkPicture

Spazio dei nomi Microsoft.Ink

InkPicture

Cursors

InkPicture.SetAllTabletsMode

InkPicture.SetSingleTabletIntegratedMode