FuZion
Well-known member
- Joined
- Jan 28, 2007
- Messages
- 47
- Programming Experience
- Beginner
I have written a basic chat application which has two text boxes: one for the messages and one to type a message. I have two events for the program, one is a Send Button click event, and another is a text box keypress event.
The keypress listens for the enter/return key to be pressed, and then it sends the message just as the send button click event does. However, there is an extremely annoying "ping" sound that plays when I press the enter key. Is there any way to get rid of this?
Here is my code...
Thanks in advance!
FuZion
The keypress listens for the enter/return key to be pressed, and then it sends the message just as the send button click event does. However, there is an extremely annoying "ping" sound that plays when I press the enter key. Is there any way to get rid of this?
Here is my code...
VB.NET:
Private Sub txtAppCommand_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtChatMessage.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Enter) Then
frmMain.client.Send("[pmsg]/" & Me.cid & "/<" & frmMain.firstName & " " & frmMain.lastName & "> " & txtChatMessage.Text)
Log("<" & frmMain.firstName & " " & frmMain.lastName & "> " & txtChatMessage.Text)
txtChatMessage.Clear()
End If
End Sub
Thanks in advance!
FuZion