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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change selected with RMouseButton

Status
Not open for further replies.

victor7

Programmer
Jul 30, 2002
11
0
0
US
Hi,

I displayed a tree in CTreeView and have a pop up menu displayed with the right mouse button. Right now I have to use the left mouse button to select a node in the tree and then press right mouse button. If I directly go to a node in the tree and press right mouse button, it will display the pop up menu for the previously selected node in the tree. So I want to ask if anyone knows how to change the selected node with the right mouse button also.

Thanks.
 
I found this also, here is the way I resolved it:

where m_feedtree is my treeview

Code:
// actions performed on right-click
HTREEITEM TreeItem;

TreeItem = m_feedtree.GetDropHilightItem();
m_feedtree.SelectItem(TreeItem);

I think this will work if you have 'Disable Dragdrop' on or off.

Hope this helps.

t_avatar.jpg

'... and then it wouldn't compile?'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top