Subject: Trouble with Invoke.
Hi.
I have a problem in this hundler
Sometimes I have exception in row lblStatusConn.Text = "Logged"; that object lblStatusConn does not created in this thread and we can't modify his property.
I noticed that this exception occured when we have weak speed of channel of connection. How I may fix this trouble?
Thank you.
I have a problem in this hundler
- private void XmppCon_OnLogin(object sender)
- {
- if (InvokeRequired)
- {
- // Windows Forms are not Thread Safe, we need to invoke this :(
- // We're not in the UI thread, so we need to call BeginInvoke
- return;
- }
- lblStatusConn.Text = "Logged";
- }
Sometimes I have exception in row lblStatusConn.Text = "Logged"; that object lblStatusConn does not created in this thread and we can't modify his property.
I noticed that this exception occured when we have weak speed of channel of connection. How I may fix this trouble?
Thank you.