Messenger Client Coding

Messenger Client Coding

  

'Frm client coding
Private Sub Cmd_Send_Click()
On Error GoTo Ex
If Len(Txt_Cli_Msg.Text) > 0 Then
 'Txt_Show_Msg.Text = Txt_Show_Msg.Text + vbCrLf + Trim(Txt_Cli_Msg.Text)
 TcpClient.SendData frmClient.Caption + " : " + Txt_Cli_Msg.Text
 Txt_Cli_Msg.Text = ""
End If
Exit Sub
Ex:
  MsgBox "Server is in offline"
End Sub
Private Sub Form_Load()
 TcpClient.RemoteHost = "PAN1"
 TcpClient.RemotePort = 1002
 TcpClient.Connect
 Unload frmLogin
End Sub<
Private Sub TcpClient_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
TcpClient.GetData strData
Txt_Show_Msg.Text = Txt_Show_Msg.Text + vbCrLf + strData
End Sub
Private Sub Txt_Cli_Msg_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
  Call Cmd_Send_Click
End If
End Sub
'Frm Login Coding Private Sub Cmd_Log_Click()
If Len(Txt_Usr.Text) > 0 Then
 frmClient.Caption = Trim(Txt_Usr.Text)
 frmClient.Show
 Unload Me
Else
 MsgBox "Enter User ...."
 Txt_Usr.SetFocus
End If
End Sub

You might also like...

Comments

Hari K I am Hari, TL in a Pvt Firm. I have knowledge in Dot Net, WM, VB6, Visual Foxpro, Foxpro, SQL Server, Oracle, Access, DBase and Crystal Report.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Beware of bugs in the above code; I have only proved it correct, not tried it.” - Donald Knuth