Condividi tramite


Proprietà Cursor.Inverted

Aggiornamento: novembre 2007

Ottiene un valore che indica se il cursore è l'estremità invertita della penna.

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

Sintassi

'Dichiarazione
Public ReadOnly Property Inverted As Boolean
'Utilizzo
Dim instance As Cursor
Dim value As Boolean

value = instance.Inverted
public bool Inverted { get; }
public:
property bool Inverted {
    bool get ();
}
/** @property */
public boolean get_Inverted()
public function get Inverted () : boolean

Valore proprietà

Tipo: System.Boolean
true se il cursore è l'estremità invertita della penna, false se il cursore non è l'estremità invertita della penna o la penna non supporta un cursore associato all'estremità invertita della penna.

Note

I cursori invertiti sono in genere associati alla cancellazione, pertanto una penna nota potrebbe disporre di un'estremità destinata al disegno dell'input penna e di un'altra estremità destinata alla cancellazione dei tratti. Tuttavia, quando il sistema riconosce l'estremità invertita della penna il comportamento non è limitato alla cancellazione. È possibile associare qualsiasi comportamento accettabile del cursore alla proprietà Inverted.

Per ulteriori informazioni sulla cancellazione dell'input penna, vedere Erasing Ink with the Pen.

Nota

L'utilizzo della proprietà Inverted dipende esclusivamente dalle esigenze dell'applicazione. Le applicazioni non sono necessarie per esaminare i cursori invertiti e l'agente di raccolta dell'input penna applica gli attributi di disegno predefiniti ai cursori invertiti allo stesso modo in cui li applica ai cursori non invertiti.

Nota

Se chiamata all'interno di alcuni gestori di messaggi è possibile che questa funzione venga reimmessa, provocando risultati imprevisti. Prestare attenzione per evitare una chiamata rientrante durante la gestione di uno dei messaggi seguenti: WM_ACTIVATE, WM_ACTIVATEAPP, WM_NCACTIVATE, WM_PAINT, WM_SYSCOMMAND se wParam è impostato su SC_HOTKEY o SC_TASKLIST e WM_SYSKEYDOWN (durante l'elaborazione delle combinazioni di tasti ALT-TAB o ALT-ESC). Questo problema è relativo alle applicazioni con modello di apartment a thread singolo.

Esempi

In questo esempio C# viene restituito un report sugli attributi di tutti i cursori rilevati 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 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

Cursor Classe

Membri Cursor

Spazio dei nomi Microsoft.Ink

DrawingAttributes