I am currently creating a chat system. The receiving end of the client side is managed by a separate thread so that when it receives a message from another client, a new Form is loaded bearing the message of the sender. The problem is, the newly loaded form is frozen and is not responding [due to the blocked methods I use (?)]. How can I solve that problem? I am new to C# so please put in the code snippet.
Share
It is frozen because you created it on another thread and that thread didn’t call Application.Run(). Which is required to ‘pump the message loop’. More here.
Don’t create windows on another thread. Use BackgroundWorker or Control.BeginInvoke or Dispatcher.BeginInvoke to let the UI thread of your program create the window.