Solved

CTreeCtrl - highlighting an item

Posted on 1997-09-30
3
1,272 Views
Last Modified: 2013-11-20
I want to programatically highlight an item in a tree control. I can select it no problem using m_ctlTree.Select( hSelected, TVGN_CARET ) - this expands nodes to display the item, but it is not highlighted. I also tried SetItemState with TVIS_SELECTED but this did nothing.
0
Comment
Question by:psen
3 Comments
 
LVL 1

Expert Comment

by:ohell
ID: 1307258
Select() should normally highlight the item, but you might have the focus on some other control....try setting the focus to the tree control before calling Select()  
0
 

Author Comment

by:psen
ID: 1307259
Thanks for the speedy response - is there any way I can highlight an item without setting focus to the tree - the control is not enabled at this point.
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 50 total points
ID: 1307260
Use the style TVS_SHOWSELALWAYS to display the selection at all times regardless of whether the control has focus.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now