1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How can I refresh the expand sign in a treeview control ?

Discussion in 'Win32' started by InvaderJOBO, Jan 8, 2009.

  1. InvaderJOBO

    InvaderJOBO New Member

    Joined:
    Jan 8, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hello...

    I am working on a treeview control window and I would like to know how I can refresh the expand sign in front of it. If I add a new item into an existing item, the + sign do not show. I must double-click the item (expand it) for it to refresh...

    Thanx...
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,287
    Likes Received:
    364
    Trophy Points:
    83
    There is a property where + sign is always shown and so you need to set that property
     
  3. InvaderJOBO

    InvaderJOBO New Member

    Joined:
    Jan 8, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Is it a property or a style ? I'm using plain win32, not MFC...

    I checked all the TVS_ and TVIF_ and none seems to be the right one... Guess it's back to digging in the MSDN doc...
     
  4. carl1

    carl1 New Member

    Joined:
    Sep 7, 2008
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    No, it has nothing to do with the style.
    Your code is just wrong.
     
  5. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,287
    Likes Received:
    364
    Trophy Points:
    83
    This code should help you.

    Code:
    	HTREEITEM hitem = tree.InsertItem(_T("Shabbir"));
    	tree.InsertItem(_T("Another one"),hitem);
    	tree.Expand(hitem,TVE_EXPAND);
    
    tree is a CTreeCtrl object
     

Share This Page