c# - Hosting Controls over Multiple Threads in .Net -


i have problem , after 3 days still can not find answer.

i creating usercontrol. control has 2 controls hosted on it. 1 edit field , other margin hold line numbers , other user added stuff.

what trying instantiate these separate controls in own threads , perform tasks on these threads eg painting , updating. usercontrol thread filter messages , direct same correct control. doing overriding wndproc method.

doing message stuff fine how instantiate controls. once thread creates these controls finishes wont threads die , controls became inaccessible. sorry no code @ moment, tend lot of research before coding can't seem find can of help.

this not going work well. ui elements (forms, controls, etc.) have thread affinity requirements dictate can ever accessed thread created them. trying embed control hosted on 1 thread in control thread effort in futility. if can work (and use term "work" loosely here) results may unpredictable @ best. need rethink approach. much better host of controls on same thread , shuttle off time consuming operations worker thread. remember, keep worker thread busy non-ui related operations only. once operation complete can marshal on results ui thread can dispatched appropriately controls.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -