Tree control grayed
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Tree control grayed

  1. #1
    Join Date
    Aug 2003
    Posts
    213

    Tree control grayed

    Hi,

    I might have posted a similar question earlier, but didn't get any answer. In my SDI application I have a tree control, which is loaded from a xml document. While loading part of the document becomes grayed, if I minimize the application and restore again, the gray portion goes away. Sometimes, when there is no gray portion in the tree control minimizing and restoring creates gray portion in the tree control, but there is no specific rule by which it happens. Was wondering why it is happening, can anybody help?

    Thanks

  2. #2
    Join Date
    Sep 2002
    Location
    14 39'19.65"N / 121 1'44.34"E
    Posts
    9,815
    I'm not sure what you mean by 'graying', I never saw that happen to a tree control (although I remeber having read about that in another post - I don't know if it was yours). I can only imagine that it is an update problem while the tree control is busy inserting data and doesn't redraw quickly enough. Please try the following:
    Code:
    m_treeCtrl.SetRedraw(FALSE);
    
    // Insert your data here
    
    m_treeCtrl.SetRedraw(TRUE);
    m_treeCtrl.Invalidate(TRUE);
    Note that this is not just a guess to work around your problem - it is code you should add anyway when you are adding large amounts of data to a tree control in order to significantly speed things up. But in your case, I'm optimistic that it wil also solve the graying problem.

  3. #3
    Join Date
    Aug 2003
    Posts
    213
    As usual Mr. gstercken is the rescuer (you are definitely my favorite guru on this forum). The loading problem is solved.
    Sometimes when I minimize and restore, the tree control is getting grayed, any idea on that?

    Thanks a lot man!

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center