Moving/Swapping values in a TREEVIEW
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Moving/Swapping values in a TREEVIEW

Threaded View

  1. #1
    Join Date
    Jun 2011
    Posts
    14

    Moving/Swapping values in a TREEVIEW

    I appologize if this is a duplicate, but I could not find my first post.
    =====================
    Hello All:
    I just realized this section of the forum is available.

    I have a problem with some existing source code. I think I can tell you the lines that need to be modified, I just don't understand this enough to be able to make the change.

    Some fine folks here have helped me get this far, but I just can't get over this hump.

    I have attached the current project and associated source code, along with printscreens.

    Here is a summary of the problem.
    1)Run the project
    2)Select 'Load Tree'
    3)Select 'Sort'
    4)Look at Tv1 this is where the information is sorted and redisplayed.
    5)Everything NODE ending with an "*" should be sorted to the bottom of the tree, ALONG WITH everything under it.

    This is where my problem comes in. The second level is sorted to the end, but not the values underneath it.

    It is my understanding that when a node is moved/swapped everything under it will go with it. That is children stay with their parent. If it were working that way, my problem would be solved. However this code is moving the parent and leaving the children behind.

    I believe the problem is in the SortChild Sub and in the following lines, but I can't be sure

    Code:
                    Set chTemp = ch1(intI)
                    Set ch1(intI) = ch1(intRnd)
                    Set ch1(intRnd) = chTemp
    BEFORE SORT
    Name:  BEFORE.png
Views: 73
Size:  12.7 KB

    AFTER SORT
    Name:  AFTER.png
Views: 66
Size:  13.8 KB

    Should be:
    Name:  should.png
Views: 71
Size:  17.3 KB
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center