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
属性

フィールド

名前 説明
None 1

TreeView コントロールのクライアント領域内の位置。ノードまたはノードの一部上の位置ではありません。

Image 2

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

Label 4

TreeNodeのテキスト部分上の位置。

Indent 8

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

PlusMinus 16

TreeNodeのプラス/マイナス領域上の位置。

RightOfLabel 32

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

StateImage 64

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

AboveClientArea 256

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

BelowClientArea 512

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

RightOfClientArea 1024

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

LeftOfClientArea 2048

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

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

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 クラスによって使用されます。

適用対象