CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    8

    Tree Control Selections??

    I have a tree control that is dynamically created on a dialog box. When you select an item, the highlight color moves to the new item, but the selection rectangle stays on the old one until the mouse key is released. If you are trying to select a new one and you move the mouse while the key is down, the highlight color moves back to the old selection. The effect can be best seen when you deliberately go slowly. My only guess is that there is some flag that is out of place. Anyone have a clue as to why this happens? I can't reproduce the problem in other software, so it seems that it is definitely something I am doing and not just a property of the tree control.

    Here is how I create it:

    m_treeCtrl.Create(WS_VISIBLE | WS_CHILD | TVS_HASLINES | TVS_LINESATROOT |
    TVS_HASBUTTONS | TVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,
    rectTreeCtrl, this, IDC_CM_CONFIG_TREE);
    m_treeCtrl.SetWindowPos(&wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);




    Any help would be greatly appreciated!
    Mindy


  2. #2
    Guest

    Re: Tree Control Selections??

    Keep in mind that tree controls (unlike list controls) differentiate between the "Selected" item, and the current "Drag/Drop" target. Theoretically, the "selected" item keeps the focus, while the "Drag/Drop" target only has the focus if the mouse is currently over it. You may be seeing strange hilighting behavior as the tree control tries to automagically highlight potential Drag'n'Drop nodes. If you are not planning to use Drag'n'Drop on your tree control, turn it off; this may eliminate your problem.

    Cheers!
    Humble Programmer
    ,,,^..^,,,


  3. #3
    Join Date
    Apr 1999
    Posts
    8

    Re: Tree Control Selections??

    Wa-hoo! This worked! Thank you so very much!!!

    Mindy


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