Question Windows Form Freezes

oXiDe

Member
Joined
Jun 24, 2009
Messages
12
Programming Experience
1-3
Hi All,

My mate & Myself are currently building a IRC Client, a problem we have come across is when opening a chatroom the form Freezes for example.

We are currently using arrays so we can open multiple chat rooms and at this current time to open a chat room we use

VB.NET:
Channels(ChatIndex).Show()

The form opens but freezes.

I have also tried using

VB.NET:
Channels(ChatIndex).ShowDialog()
Application.DoEvents()

Using the above code, the form does not freeze but appears we can not access any of the controls such as (RTB)

What would be causing the form to freeze on .show(), Has anyone else had any similar issues?


Your help would be much Appreciated.


Thank you
oXiDe
 
You're probably calling a blocking method, like TcpListener.AcceptTcpClient. If you need to call such methods then you need to do so on a secondary thread, so the primary thread is available to maintain your UI.
 
We don't call or use TcpListener.AcceptTcpClient
I did say "like" TcpListener.AcceptTcpClient. It was just an example of the sort of thing you might be doing.
 
Back
Top