|
-
Sep 27th, 2005, 05:50 AM
#1
Thread Starter
Hyperactive Member
Another thread problem... Cross-thread operation not valid (Resolved)
Does anyone know why I get this error?
Cross-thread operation not valid: Control 'TextBox1' accessed from a thread other than the thread it was created on.
It happens when I try to modify TextBox1's properties from a thread I created.
The thread is a private variable in a class which raises an event. The handler of the event raised is where I tried to modify TextBox1.
Code used to create thread
sckTick = New Thread(AddressOf CallbackTick)
sckTick.Start()
Code of event handled, in thread sckTick
Private Sub sckMainConnected() Handles sckMain.Connected
MsgBox("Connected", MsgBoxStyle.Information, "")
TextBox1.Enabled = True
End Sub
Any ideas what I'm doing wrong?
Last edited by Cade; Sep 27th, 2005 at 06:29 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|