Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't hightlight CTreeCtrl item.

Status
Not open for further replies.

sulacco

Technical User
Nov 8, 2002
74
RU

Hi, People. Can't figure out how to highlight CTreeCtrl Item when I
click on the one in stand alone function.

Code:
	CTreeCtrl& m_ctlTree=GetTreeCtrl();
	CSplitterDoc* pDoc = GetDocument();
	
	HTREEITEM hItem=m_ctlTree.GetSelectedItem();
	m_ctlTree.Select(hItem,TVGN_DROPHILITE   );
    	m_ctlTree.SelectItem(hItem);
	pDoc->UpdateAllViews(NULL);
This will work only when I click on the item second time.
How to make it smooth, please?
Tnx for advance.
 
Is your code being called twice, or the first time you click, are you simply transferring focus to the tree control?

(Try putting a break point on the code and seeing if your code breaks both times, or just the 1st)

K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top