Results 1 to 7 of 7

Thread: TreeView Hangs

Hybrid View

  1. #1

  2. #2

    Thread Starter
    New Member
    Join Date
    Feb 2004
    Posts
    13

    Resolved Re: TreeView Hangs

    I tried inloading the nodes but that didn't solve the problem. Here's the code used to close the program.

    VB Code:
    1. Private Sub cmdQuit_Click()
    2.  
    3.     ' Clear the nodes
    4.     TreeView1.Nodes.Clear
    5.     ' Unload the Form
    6.     Unload frmListView
    7.     ' Close and End
    8.     Close: End
    9.  
    10. End Sub

    I've attached a zip file containing the project. Maybe you can spot something there. (excuse the coding, I'm self taught)

    Thanks,

    Dave W
    Attached Files Attached Files

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: TreeView Hangs

    There's nothing wrong with the code you show. I'm a little concerned about the Close: label and I hope you are not doing a GoTo Closesomeplace in the Sub. If you aren't then it doesn't hurt anything but you don't need the label.

    I think I remember someone else having a problem closing a form that had a large treeview. It will probably be hard to find but you might use the Advanced Search and look for something like treeview close and see what you can find.

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2004
    Posts
    13

    Resolved Re: TreeView Hangs

    Hi Marty,

    The "Close: End" is not a Close label, I just put the two statements on the same line separated with a colen. i.e.

    Close
    End

    I'll do another search and see if I can find an answer. This one sure has me baffled! Thanks for your help.

    Dave W

  5. #5

  6. #6
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657

    Re: TreeView Hangs

    I'm not sure what's causing your issue, but one thing to consider is dynamically populating the childen nodes when the parent node is expanded - i.e., load only the countries first - then when a country is expanded, load the corresponding states - when the state is expanded, load the cities - and so on. (you could even remove the children nodes when the parent is collapsed)

    This of course requires a bit more coding on your part, but it will keep the node count to a minimum ...
    "It's cold gin time again ..."

    Check out my website here.

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