CTreeCtrl display problems
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: CTreeCtrl display problems

Hybrid View

  1. #1
    Join Date
    Aug 1999
    Location
    VA
    Posts
    12

    CTreeCtrl display problems

    I am having problems with my CTreeCtrl that is displayed in a FormView. I am using the +/- buttons to allow expansion/colapse of the tree branches. It is used with a tab control and other controls, for reference. *grin*

    The problem is that when I have several branches expanded to the point where I get a vertical scroll bar and a child node is selected, the control does not properly refresh when the +/- button is clicked to collapse the branch and the scrollbars go away (the area below the newly selected parent node is grey). If I have a parent node selected when it is collapsed, the display updates correctly.

    Also, if I have the tooltips enabled for the control and I click and hold on the scroll bar to drag it up and down, I get grey bars on the control if the cursor crossed into the Tree client area and a tool tip temporarily displays.

    I have tried to turn the control's redraw off during expansion/collapse. That clears up the grey display problem, but the scrollbar area and frame do not refresh then. I tinkered with the parent window's refresh as well, and got even closer...but now I am stumped. Close but no cigar. *grin*

    Anyone have any ideas or suggestions?

    (Note: my FormView is a child window in a CSplitterWnd, in case that may be a factor)

    Thanks for the time.


  2. #2
    Join Date
    Oct 2003
    Posts
    6
    hehe....I'm going to bring this post back from the dead.

    I am having the exact same problem as this person. I have a tree control inside of a docking window, and it is not properly refreshing when the scrollbars are present and a child item is selected. As soon as teh node is collapsed, the control display goes wacky, and doesn't refresh correctly. This post described it so well that I revived it instead of typing a new one. Does anyone have any ideas?? I'm really stumped on this one.....i've been messing with it for hours.

  3. #3
    Join Date
    Sep 2002
    Location
    14 39'19.65"N / 121 1'44.34"E
    Posts
    9,815
    I've heard of that strange problem a few times, but never managed to reproduce it myself. Although more a workaround than a solution, the following thread may help.

  4. #4
    Join Date
    Oct 2003
    Posts
    6
    Thanks for your reply!

    I finally got it figured out!

  5. #5
    Join Date
    Sep 2002
    Location
    14 39'19.65"N / 121 1'44.34"E
    Posts
    9,815
    Originally posted by alake
    I finally got it figured out!
    Does it mean the info from the other thread fixed it? I'm interested in this, as I've heard of that phenomenon more than once without ever seeing it, and I would like to figure out the cause.

  6. #6
    Join Date
    Oct 2003
    Posts
    6
    Sorry, I should have been more specific in what the cause was

    I tried your suggestion, and it didn't seem to help. I searched the web for more info, and found this: http://www.experts-exchange.com/Prog..._20254217.html

    Basically, this guy had the same type of problem. In the post, someone mentioned that it could have to do with the "z-order". From what I gather, this has something do do with the order in which controls are displayed or refreshed on a dialog...it also has something to do with the selection order of the controls when the tab key is pressed.

    In my case, I have a dialog with multiple controls that are shown or hidden with a tab control. As the reply directed, I went into the dialog editor and played with the tab order. And suddenly it worked!! Both tree controls redraw perfectly now. I honestly don't understand exactly what causes this problem. But somehow, playing with tab selection fixed it.

    thanks again for your help....and if you have any further input on what causes this problem I'd love to hear it! It is definately very odd.
    Last edited by alake; November 13th, 2003 at 03:20 PM.

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center