frmChat.Show
frmChat.Lblpseud.Caption = txtpseudo
Unload Me
End Sub
Voici maintenant le script de ma feuille "chat" :
le bouton "envoyer" :
Private Sub Cdeenvoy_Click()
Text1.Text = Text1.Text & vbCrLf & Lblpseud.Caption & "> " & Text2
Winsock1.SendData ("" & Lblpseud.Caption & "> " & Text2.Text)
Text2 = ""
End Sub
Private Sub Text1_Change()
Text1.SelStart = Len(Text1.Text)
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Frmserver.tcpserver.LocalPort = 1001
Frmserver.tcpserver.Listen
Winsock1.Accept requestID
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim data As String
frmChat.Winsock1.GetData data
frmChat.Text1.Text = frmChat.Text1.Text & vbCrLf & data
End Sub
//le textbox text2 c ou l'on ecrit ce que l'on veut ecrire
//le textbox text1 c ou ca s'affichera