Private Sub btnSend_Click()
Dim textbuff As String
Dim newtext As String
Dim servercommand As String
textbuff = rtbIRC.Text
newtext = txtIRC.Text
If sckIRC.State = sckConnected Then
If InStr(newtext, "/") Then
servercommand = Split(newtext, "/")
sckIRC.SendData servercommand(1) & vbCrLf
Else
sckIRC.SendData "PRIVMSG " & newtext & vbCrLf
rtbIRC.Text = textbuff & vbCrLf & newtext
rtbIRC.SelStart = (Len(rtbIRC.Text))
txtIRC.Text = ""
End If
Else
MsgBox "Error: Not Connected"
End If
End Sub