Pero cuando intenta abrir el nuevo formulario me manda el siguiente error:
Cita:
Para el cliente conectarse al servidor hago el thread:cannot be instantiated because the current thread is not in a single-threaded apartment
Código:
Dim thr As New Thread(AddressOf ConectarseCliente) thr.Start()
Código:
Y cuando el cliente recibe un mensaje, se genera este evento: Private Sub ConectarseCliente()
With Cliente
If .EstadoCon = False Then
.IPDelHost = lbEquipo.Text
.PuertoDelHost = 8050
.Conectar()
End If
End With
Código:
Puse el CheckForIllegalCrossThreadCalls = False, pero tampoco funcionó con eso.Private Sub SocketCliente_DatosRecibidos(ByVal datos As String) Handles Cliente.DatosRecibidos
lbTemporal.Text = datos
Try
Select Case lbTemporal.Text
Case "IniciarTest"
frmExamen.Show()
Case "Siguiente"
frmExamen.siguiente_pregunta()
End Select
Catch ex As Exception
MsgBox("Error berraco!!" & ex.Message)
End Try
txtConversa.Text = datos & vbCrLf & vbCrLf & txtConversa.Text
End Sub
También le puse thr.SetApartmentState(ApartmentState.STA) y se queda bloqueado.
¿Qué hago? por favor ayúdenme


