CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2005
    Posts
    27

    TreeView's: Right Click Highlighting

    I currently have a tree view in my app. I've noticed that you can right click a node and highlight it, however it's not truely making that node the selected node. I'm a bit dumbfounded on either preventing that or making that node the selected node? Any ideas anyone?

  2. #2
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    1,080

    Re: TreeView's: Right Click Highlighting

    That's exactly how the folder tree in Windows Explorer behaves.

  3. #3
    Join Date
    Apr 2002
    Location
    Egypt
    Posts
    2,210

    Re: TreeView's: Right Click Highlighting

    Handle the mouse down click event and Select the node yourself.
    Hesham A. Amin
    My blog , Articles


    <a rel=https://twitter.com/HeshamAmin" border="0" /> @HeshamAmin

  4. #4
    Join Date
    Jul 2005
    Posts
    27

    Re: TreeView's: Right Click Highlighting

    If I handle the mouse click, I can't use the BEFORE or AFTER SELECT event for that will only register with the left mouse click. I could do the generic treeview CLICK event but the location for the mouse pointer never seems to match up with where it actually is on the screen.

    That will also be very problematic when I have 1000 to 2000 nodes displayed in the tree view. My whole reasoning to handling this, is because a user may right click a node to bring up the context menu to perform an action on that node, however, when the option is choosen, the action is performed on the node that was previously selected with the left mouse button. Not the currently highlighted one via the right mouse button. Any one have any good ideas to approaching this?

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

Featured