ok when i hit enter on my text box everything works fine but windows Dings or beeps what every it is! got nay idea's hot to stop it :)
Private Sub TextSend_KeyDown(KeyAscii As Integer, Shift As Integer)
If (KeyAscii = 13) Then
Text1.Text = Text1.Text & "<" & CleanSlateBot1.Username & "> " & TextSend.Text & vbCrLf
CleanSlateBot1.Send TextSend.Text
TextSend.Text = ""
Else
End If
End Sub
Set KeyAscii to 0 after you're done sending or whatever.
Private Sub TextSend_KeyDown(KeyAscii As Integer, Shift As Integer)
If (KeyAscii = 13) Then
Text1.Text = Text1.Text & "<" & CleanSlateBot1.Username & "> " & TextSend.Text & vbCrLf
CleanSlateBot1.Send TextSend.Text
TextSend.Text = ""
KeyAscii = 0
End If
End Sub
thx for trying to help but it still dings :/
As long as the variable KeyAscii is 0 when the subroutine finishes, it won't ding. :\
Private Sub TextSend_KeyDown(KeyAscii As Integer, Shift As Integer)
If (KeyAscii = 13) Then
Text1.Text = Text1.Text & "<" & CleanSlateBot1.Username & "> " & TextSend.Text & vbCrLf
CleanSlateBot1.Send TextSend.Text
TextSend.Text = ""
KeyAscii = 0
Else
End If
End Sub
if this code is right it still dings for me =[
Why dont you try
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text1.Text = Text1.Text & "<" & CleanSlateBot1.Username & "> " & TextSend.Text & vbCrLf
CleanSlateBot1.Send TextSend.Text
TextSend.Text = ""
KeyAscii = 0
End If
End Sub
ah yes this works but you have to add
Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii = 13) Then
Text1.Text = Text1.Text & "<" & CleanSlateBot1.Username & "> " & TextSend.Text & vbCrLf
CleanSlateBot1.Send TextSend.Text
TextSend.Text = ""
KeyAscii = 0
End If
End Sub
i needed the "("")" around keyascii = 13
You shouldn't in visual basic.. you only need brackets in an "if"in c++.
Quote from: iago on July 11, 2003, 07:12 AM
You shouldn't in visual basic.. you only need brackets in an "if"in c++.
some (old) c++ compilers dont even require
parentheses around it if it's a single bool
[edit] err, all if statements take a single bool, but i mean just a single variable cast as bool