System.InvalidOperationException was unhandled
Message=Cross-thread operation not valid: Control 'lblMessage'
accessed from a thread other than the thread it was created on.
Perchᅵ ?
Questo ᅵ il codice:
Private Sub StartListen()
intPort = Integer.Parse(txtPort.Text)
myTcpListener = New TcpListener(Net.IPAddress.Any, intPort)
Dim blnConection As Boolean = False
Try
myTcpListener.Start()
lblMessage.Text = "Waiting..."
....
Grazie, Alverman
Ma ora che ho risolto ho un'altro errore.
Dovendo modificare la stessa textbox da un'altra sub ho aggiunto la
stessa riga ma mi esce un'altro errore.
ChangeControlText(txtMessage, "From client - " + clNo + " : " +
dataFromClient)
A designtime di sottolinea ChangeControlText con l'errore
Error2 Reference to a non-shared member requires an object reference.
Ho giᅵ cercato in lungo e in largo ma non riesco a risolverlo
Mi date una mano per favore.
Grazie, Alverman