You have several options. First, you can pre-create all of your nodes. Then
add them
later. If you have thousands of nodes, and you really need to insert them over
time, then
you just need to BeginInvoke or Invoke your insertion delegate. I have a sample
showing
async operations over a ListBox that might help, though I don't have one
available for the
TreeView.
What does it take to make an Asynchronously drawn ListBox in Windows Forms?
http://weblogs.asp.net/justin_rogers.../01/65805.aspx
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog:
http://weblogs.asp.net/justin_rogers
"Mitch A" <no*@none.com> wrote in message news:40**********@newspeer2.tds.net...
I have an app that populates a treeview from a DB. I would like the UI to
repaint during this potentially long operation, so I want to spawn a new
thread to populate the list. The problem is how to update the treeview from
the worker thread without violating the prime directive of Windows
programming-Though shalt not operate on a window from other than its
creating thread.
Can someone point me to a simple implementation of this? Thanks!