Click to See Complete Forum and Search --> : Gui controls & Threads


inbal666
March 31st, 2002, 06:11 AM
Hi,
I want to add a large number of nodes to a tree-view, but such operation halts the app.
I've tried using a separate thread, but the framework won't allow it, because the thread I've created it's the one that holds the control's windows handle.
Is there a way to pass that handle?
10X

Inbal

Arild Fines
March 31st, 2002, 12:51 PM
Take a look at the Control.Invoke method.

The world holds two classes of men -- intelligent men without religion, and religious men without intelligence. Abu'l-Ala-Al-Ma'arri (973-1057; Syrian poet)

inbal666
April 1st, 2002, 01:47 AM
Hi,
I've tried it, but the result was the same. 'Invoke' calls my method on the main thread, which means that the app stucks all the same.
Help!!!

Inbal

Innocent
April 10th, 2002, 09:54 AM
Just a suggestion...
1) Create a new thread
2) Create new treeview (just class reference, no visuals) inside that thread
3) Populate the thread inside the class
4) When done, pass the reference of thread's treeview to the application's treeview and run a refresh on application's treeview