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. Problem in TreeControl

Problem in TreeControl

Scheduled Pinned Locked Moved C / C++ / MFC
data-structureshelp
3 Posts 3 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.
  • K Offline
    K Offline
    Krishnatv
    wrote on last edited by
    #1

    HI, Iam Doing An application Using Tree Control. My problem is If I double Click on Any Root Item on the Tree That Should be display in one Edit Box. But Iam not Getting . plz check this code void CTreeItem::OnDblclkTree1(NMHDR* pNMHDR, LRESULT* pResult) { // m_Tree is Tree Control Variable HTREEITEM hItem = m_Tree.GetRootItem(); if ((hItem != NULL) && m_Tree.ItemHasChildren(hItem)) { m_Tree.Expand(hItem, TVE_EXPAND); m_Tree.EnsureVisible(hItem); } CString str=m_Tree.GetItemText( hItem ); UpdateData(FALSE); CDUXmlRuleDlgDlg duxml; // m_strNodeName is My Edit Box Control Variable. duxml.m_strNodeName = str; UpdateData(FALSE); *pResult = 0; } plz check this

    A P 2 Replies Last reply
    0
    • K Krishnatv

      HI, Iam Doing An application Using Tree Control. My problem is If I double Click on Any Root Item on the Tree That Should be display in one Edit Box. But Iam not Getting . plz check this code void CTreeItem::OnDblclkTree1(NMHDR* pNMHDR, LRESULT* pResult) { // m_Tree is Tree Control Variable HTREEITEM hItem = m_Tree.GetRootItem(); if ((hItem != NULL) && m_Tree.ItemHasChildren(hItem)) { m_Tree.Expand(hItem, TVE_EXPAND); m_Tree.EnsureVisible(hItem); } CString str=m_Tree.GetItemText( hItem ); UpdateData(FALSE); CDUXmlRuleDlgDlg duxml; // m_strNodeName is My Edit Box Control Variable. duxml.m_strNodeName = str; UpdateData(FALSE); *pResult = 0; } plz check this

      A Offline
      A Offline
      AJarrett
      wrote on last edited by
      #2

      If I've understood your intent, I think you want to have the edit box filled with the item text from the node you double clicked. The HTREEITEM returned by GetRootItem is instead going to point to the root of the entire tree control. Try using GetSelectedItem.

      1 Reply Last reply
      0
      • K Krishnatv

        HI, Iam Doing An application Using Tree Control. My problem is If I double Click on Any Root Item on the Tree That Should be display in one Edit Box. But Iam not Getting . plz check this code void CTreeItem::OnDblclkTree1(NMHDR* pNMHDR, LRESULT* pResult) { // m_Tree is Tree Control Variable HTREEITEM hItem = m_Tree.GetRootItem(); if ((hItem != NULL) && m_Tree.ItemHasChildren(hItem)) { m_Tree.Expand(hItem, TVE_EXPAND); m_Tree.EnsureVisible(hItem); } CString str=m_Tree.GetItemText( hItem ); UpdateData(FALSE); CDUXmlRuleDlgDlg duxml; // m_strNodeName is My Edit Box Control Variable. duxml.m_strNodeName = str; UpdateData(FALSE); *pResult = 0; } plz check this

        P Offline
        P Offline
        prasad_som
        wrote on last edited by
        #3

        Krishnatv wrote:

        My problem is If I double Click on Any Root Item on the Tree That Should be display in one Edit Box.

        That edit box is on CDUXmlRuleDlgDlg , but in your code, I cant see , you have invoked it.

        Krishnatv wrote:

        CDUXmlRuleDlgDlg duxml; // m_strNodeName is My Edit Box Control Variable. duxml.m_strNodeName = str; UpdateData(FALSE);

        UpdateData should be called here on you dialog object, after displaying it.

        Prasad Notifier using ATL | Operator new[],delete[][^]

        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