TreeViewHitTestLocations 列挙型

定義

TreeView または TreeNode の領域を表す定数を定義します。

この列挙体は、メンバー値のビットごとの組み合わせをサポートしています。

public enum class TreeViewHitTestLocations
[System.Flags]
[System.Runtime.InteropServices.ComVisible(true)]
public enum TreeViewHitTestLocations
[System.Flags]
public enum TreeViewHitTestLocations
[<System.Flags>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type TreeViewHitTestLocations = 
[<System.Flags>]
type TreeViewHitTestLocations = 
Public Enum TreeViewHitTestLocations
継承
TreeViewHitTestLocations
属性

フィールド

AboveClientArea 256

TreeView コントロールのクライアント部分の上にある位置。

BelowClientArea 512

TreeView コントロールのクライアント部分の下にある位置。

Image 2

TreeView または TreeNode に含まれているイメージの境界内にある位置。

Indent 8

TreeNode のインデント領域内の位置。

Label 4

TreeNode コントロールのテキスト部分の位置。

LeftOfClientArea 2048

TreeView コントロールのクライアント部分の左側の位置。

None 1

TreeView コントロールのクライアント領域内だが、ノードやノードの一部ではない位置。

PlusMinus 16

TreeNode コントロールのプラス/マイナス領域の位置。

RightOfClientArea 1024

TreeView コントロールのクライアント部分の右側の位置。

RightOfLabel 32

TreeNode のテキスト領域の右側の位置。

StateImage 64

TreeNode の状態イメージの境界内の位置。

次のコード例では、 列挙体を使用する方法を TreeViewHitTestLocations 示します。 この例を実行するには、 という名前treeView1のコントロールを含む Windows フォームに次のコードをTreeView貼り付け、 に項目をTreeView設定します。 フォームの MouseDown イベントと イベントが、この例の メソッドにHandleMouseDown関連付けられていることをtreeview1確認します。

void HandleMouseDown(object sender, MouseEventArgs e)
{
    TreeViewHitTestInfo info = treeView1.HitTest(e.X, e.Y);
    if (info != null)
        MessageBox.Show("Hit the " + info.Location.ToString());
}
Private Sub HandleMouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) _
    Handles Me.MouseDown, treeView1.MouseDown
    Dim info As TreeViewHitTestInfo = treeView1.HitTest(e.X, e.Y)
    If (info IsNot Nothing) Then
        MessageBox.Show("Hit the " + info.Location.ToString())
    End If

End Sub

注釈

TreeViewHitTestLocations 列挙体は TreeViewHitTestInfo クラスによって使用されます。

適用対象