ThreadPool.QueueUserWorkItem new Form CreateHandle Deadlock

Posted by bogdanbrudiu on Stack Overflow See other posts from Stack Overflow or by bogdanbrudiu
Published on 2010-04-27T07:15:22Z Indexed on 2010/06/14 20:12 UTC
Read the original article Hit count: 284

Filed under:
|
|
|

I have a thread that needs to create a popup Window. I start the thread using ThreadPool.QueueUserWorkItem(new WaitCallback(CreatePopupinThread)) Thew thread creats a new form. The application freases in the new Form constructor at CreateHandle. The Worker Thread is locked... How can I fix this?

this is how I create the form

var form = new ConfirmationForm
                           {
                               Text = entry.Caption,
                               Label = entry.Text,
                           };

In the constructor the thread enters a deadlock

public ConfirmationForm()
        {
            InitializeComponent();
        }

© Stack Overflow or respective owner

Related posts about winforms

Related posts about thread