Results 1 to 1 of 1

Thread: Need help solving a bug in code - Moving values in a treeview using Vb6

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2011
    Posts
    69

    Need help solving a bug in code - Moving values in a treeview using Vb6

    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 figure this should only take a few minutues of an experienced programmers time, and I am willing to pay for that time.

    I am not sure how one goes about exchanging the funds, I assume we can use paypal.

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

    I guess the proper way of doing this is if you are interested send me a PM and we can go from there.

    If I have broken any protocol or forum rules please let me know and I will work to fix my error.


    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
    Here are a few print screens.
    After loading the Tree, but BEFORE SORT
    Name:  BEFORE.png
Views: 174
Size:  12.7 KB

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

    WHAT IT SHOULD BE
    Name:  should.png
Views: 139
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
  •  



Click Here to Expand Forum to Full Width