Results 1 to 2 of 2

Thread: Can you disable the nodeclick event in TreeView?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    14
    I'm trying to make an Explorer type app. If I collapse a node, and after the collapse event completes the mouse is now over another node, it generates a nodeclick event on that node. Then this node gets selected. Normally in Windows Explorer, if you collapse a node with a selected child node, the collapsed node becomes selected.

    Normally when you collapse, the mouse remains over the plus/minus box. The problem above happens when you have lots of expanded nodes, such that the vertical scroll bar is displayed, and then collapse so that the scroll bar is no longer needed. Then the nodes above the node you collapsed may move under the mouse before you release the mouse, thereby generating a nodeclick event.

    Please, please, please help. My nodeclick event calls a lengthy procedure which should only be called when you actually click a node...


  2. #2
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    NY
    Posts
    497
    You could test for and set a flag like bInClickEvent inside the Node_Click event:
    Node_Click()
    If bInClickEvent Then Exit Sub
    bInClickEvent = True
    ...
    bInClickEvent = False
    End Sub
    However, I am not sure if it will keep another node from appearing selected.

    You could also try some technique to hourglass the mouse--disable access to the form immediately upon entering the sub and returning control before exiting.

    end war
    stop greed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width