共用方式為


Cursor.Inverted 屬性

取得值,這個值表示游標是否為畫筆的反轉端。

命名空間:  Microsoft.Ink
組件:  Microsoft.Ink (在 Microsoft.Ink.dll 中)

語法

'宣告
Public ReadOnly Property Inverted As Boolean
'用途
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

屬性值

型別:System.Boolean
如果游標是畫筆的反轉端,則為 true,如果游標不是畫筆的反轉端,或者畫筆不支援與畫筆之反轉端相關聯的游標,則為 false。

備註

反轉游標通常與擦去動作相關聯,因此已知畫筆可能有一端用來繪製筆墨,另一端用來擦去筆劃。不過,系統辨識畫筆反轉端的行為不限於擦去。您可以將任何可接受的游標行為與 Inverted 屬性產生關聯。

如需擦去筆墨的詳細資訊,請參閱Erasing Ink with the Pen

ms581967.alert_note(zh-tw,VS.90).gif注意事項:

您是否要使用 Inverted 屬性完全視應用程式需要而定。應用程式不需要檢查反轉游標,而且「筆墨收集器」會將預設繪圖屬性套用至反轉游標,就像處理非反轉游標時一樣。

ms581967.alert_note(zh-tw,VS.90).gif注意事項:

如果在特定訊息處理常式內呼叫的話,可能會重新輸入這個函式,造成非預期的結果。處理下列訊息時,請小心避免使用可重新進入的呼叫:WM_ACTIVATEWM_ACTIVATEAPPWM_NCACTIVATEWM_PAINTWM_SYSCOMMAND (如果 wParam 設定為 SC_HOTKEY 或 SC_TASKLIST) 和 WM_SYSKEYDOWN (處理 ALT+TAB 或 ALT+ESC 組合鍵時)。不過在單一執行緒 Apartment Model (STA) 應用程式中會發生問題。

範例

這個 C# 範例會傳回一份報告,內容是關於做為參數傳入之 InkCollector 物件遭遇的所有游標屬性。

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;
}

這個 Microsoft® Visual Basic® .NET 範例會傳回一份報告,內容是關於做為參數傳入之 InkCollector 物件遭遇的所有游標屬性。

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

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Framework

支援版本:3.0

請參閱

參考

Cursor 類別

Cursor 成員

Microsoft.Ink 命名空間

DrawingAttributes