winforms - ThreadPool.QueueUserWorkItem new Form CreateHandle Deadlock -
i have thread needs create popup window. start thread using threadpool.queueuserworkitem(new waitcallback(createpopupinthread)) thew thread creats new form. application freases in new form constructor @ createhandle. worker thread locked... how can fix this?
this how create form
var form = new confirmationform { text = entry.caption, label = entry.text, };
in constructor thread enters deadlock
public confirmationform() { initializecomponent(); }
i think better create "popup window" on ui thread , create thread in "popup window" process want do.
as suspected, can´t show form created on non ui thread.
see answer: possible construct form on background thread, display on ui thread
Comments
Post a Comment