Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. A question about TreeCtrl

A question about TreeCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
question
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vincent Ye
    wrote on last edited by
    #1

    I have a question about TreeCtrl. When I use mouse right click one item in the TreeCtrl, this item is highlight when the right mouse key is down. But when the right mouse key is up, this item loses highlight, the previous highlight item is highlight again. How can I keep the item that I right click highlight? Thanks in advance.

    V 1 Reply Last reply
    0
    • V Vincent Ye

      I have a question about TreeCtrl. When I use mouse right click one item in the TreeCtrl, this item is highlight when the right mouse key is down. But when the right mouse key is up, this item loses highlight, the previous highlight item is highlight again. How can I keep the item that I right click highlight? Thanks in advance.

      V Offline
      V Offline
      Vincent Ye
      wrote on last edited by
      #2

      void CFileViewTab::OnRclickTreeWorkspace(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here LRESULT lReturn = 0; CPoint point(GetMessagePos()); ScreenToClient(&point); CTreeCtrl *pTree = (CTreeCtrl *)GetDlgItem(IDC_TREE_WORKSPACE); UINT flag; HTREEITEM hItem; if ((hItem = pTree->HitTest(point, &flag)) != NULL) { if (flag & TVHT_ONITEM) { pTree->SelectItem(hItem); ...... .....

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups