hi, im writing a program with multiple threads, and in one of the secondary
threads, i need to access the main form...but the code i wrote throws errors
saying i cant do this. is there anyway i can simply change the text on the
main form from another thread?
my code:
Private Sub ListenBegin()
Try
Dim ep As IPEndPoint
HomeIP = Net.Dns.GetHostEntry(Net.Dns.GetHostName).AddressL ist(0)
ep = New IPEndPoint(HomeIP, PortNumber)
ListenSocket = New Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp)
ListenSocket.Bind(ep)
ListenSocket.Listen(1)
ListenSocket.BeginAccept(AddressOf ListenCallBack, Nothing)
Catch ex As Exception
Call WriteErrors(ex.Message, "ListenBegin")
Finally
SyncLock Me
''error here
Me.Text = HomeIP.ToString
End SyncLock
End Try
End Sub
--
-iwdu15