Solved

Get Child Level in CTreeCtrl

Posted on 2000-05-08
3
797 Views
Last Modified: 2013-11-20
during drag and drop operations parent items should stay parent items, child items should stay child items, grandchildren should stay grandchildren, etc, etc. For that i want get the indentLevel of the item like

      int nDragIndent = GetIndentLevel(m_hDragItem);
      int nDropIndent = GetIndentLevel(m_hDropItem);

       if (nDragIndent == nDropIndent)
      {
            // add after the drop item, as child of drop item's parent
             htiPosition = m_hDropItem;
             m_hDropItem = GetParentItem(m_hDropItem);
      }

But i don't know how to get Indent Level.It's urgent. Please do help.Thanks in advance

- yesnathan


0
Comment
Question by:yesnathan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
Zoppo earned 50 total points
ID: 2788392
Hi yesnathan,

Just step through the parent items somehow like this:

int GetIndentLevel( HTREEITEM hItem )
{
 int level = 0;
 while ( NULL != ( hItem = GetParentItem() ) )
  level++;
 return level;
}

hope that helps,

ZOPPO
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 2788394
sorry, a typo ... should be:

while ( NULL != ( hItem = GetParentItem( hItem ) ) )
0
 

Expert Comment

by:yesnathan22
ID: 2791142
Hello brother Zoppo,
     i do the same thing it's work well.Thank you very much for your help.I am beginer in VC++.Some times i may need your help.so i want keep in touch with you.Can you please give me your email id.my id yesnathan22@usa.net my messanger id is yesnathan_2000(in yahoo messanger) i am looking forward from you.Bye.

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

690 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