tagCANDY CGI VBレスキュー(花ちゃん)の Visual Basic 6.0用 掲示板
VBレスキュー(花ちゃん)の Visual Basic 6.0用 掲示板
[ツリー表示へ]  [ワード検索]  [Home]

タイトル Re^2: TreeView MouseMoveで、当該ノードでの x ,y 位置
投稿日: 2010/09/09(Thu) 08:45
投稿者ima
魔界の仮面弁士さん

またも的確なアドバイスを戴き、解決しました。

'マウスの位置が対象ノードの上半分か下半分かの判断
Private Function UpperLowerTest(SelNode As Node, ByVal x As Single, ByVal y As Single) As Boolean
Dim oNode As Node, Un As Long, Ln As Long, n As Long
    n = y
    Do
        n = n - Screen.TwipsPerPixelY   'ピクセル単位でLoop回数抑える
        Un = Un + 1
        Set oNode = TreeView1.HitTest(x, n)
        If oNode Is Nothing Then Exit Do
    Loop While SelNode Is oNode
    n = y
    Do
        n = n + Screen.TwipsPerPixelY
        Ln = Ln + 1
        Set oNode = TreeView1.HitTest(x, n)
        If oNode Is Nothing Then Exit Do
    Loop While SelNode Is oNode
    If Un < Ln Then
        UpperLowerTest = True
    Else
        UpperLowerTest = False
    End If
End Function

どうも有り難うございました。

- 関連一覧ツリー をクリックするとツリー全体を一括表示します)

古いスレッドにレスはつけられません。