Gui controls & Threads
-
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? :mad: 10X Inbal
-
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? :mad: 10X Inbal
First call Begin/End Update on the treeview that should speed up the process a bit because it won't try to redraw after every addtion. Then instead of calling the actual methods on the treview object you need to use the Invoke method on the object, which will marshal your calls to the thread that owns the handle. The documentation will have to be your guide on on using Invoke because I've got another 2-3 days before I'm about to tackle the same thing in my app :-P HTH, James Sonork: Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971
-
First call Begin/End Update on the treeview that should speed up the process a bit because it won't try to redraw after every addtion. Then instead of calling the actual methods on the treview object you need to use the Invoke method on the object, which will marshal your calls to the thread that owns the handle. The documentation will have to be your guide on on using Invoke because I've got another 2-3 days before I'm about to tackle the same thing in my app :-P HTH, James Sonork: Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971
10x, 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. I need means of calling AddNode from a completely different thread, so that my main thread can still listen to user mouse clicks etc. :(( Inbal
-
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? :mad: 10X Inbal