次の方法で共有


InkOverlay.Cursors プロパティ

インク領域で使用可能な Cursors コレクションを取得します。

名前空間 :  Microsoft.Ink
アセンブリ :  Microsoft.Ink (Microsoft.Ink.dll 内)

構文

'宣言
<BrowsableAttribute(False)> _
Public ReadOnly Property Cursors As Cursors
'使用
Dim instance As InkOverlay
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
インク領域で使用可能な Cursors コレクション。

解説

それぞれのカーソルは、ペンまたは他のインク入力装置の先端に対応しています。

このコレクションのカーソルは InkOverlay オブジェクトに固有のものです。

InkOverlay オブジェクトが検出する新しいすべてのカーソルは、返された Cursors コレクションに追加されますが、InkOverlay オブジェクトが検出する順番でカーソルを返す必要はありません。

InkOverlay オブジェクト (SetAllTabletsMode メソッドの useMouseForInput パラメータが true の場合) でマウスを入力デバイスとして有効にする場合、InkOverlay がペンなど他のカーソルを検出した後にマウスが Cursors コレクションに追加されます。これは、ペンもマウスとして動作するからです。

ms582163.alert_note(ja-jp,VS.90).gifメモ :

ペンなど他のカーソルがストロークを描画した (これにより Stroke イベントが発生する) 後に、マウス カーソルの CursorInRange イベントが受け取られます。

Cursors コレクションは次に示す場合にクリア (カウントは 0 に設定され、オブジェクトを持たない) されます。

この C# の例では、パラメータとして渡された InkOverlay オブジェクトで確認されたすべてのカーソルの属性に関するレポートを返します。

using Microsoft.Ink;
//. . .
public string CursorReport(InkOverlay theInkOverlay)
{
    string theReport = "The InkOverlay has encountered the following cursors so far:" + Environment.NewLine;
    // Get the Cursors collection from the InkOverlay
    Microsoft.Ink.Cursors theCursors = theInkOverlay.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 の例では、パラメータとして渡された InkOverlay オブジェクトにより確認されたカーソルすべての属性に関するレポートを返します。

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

参照

参照

InkOverlay クラス

InkOverlay メンバ

Microsoft.Ink 名前空間

Cursors

Cursor

InkOverlay.SetSingleTabletIntegratedMode

InkOverlay.SetAllTabletsMode