when i press enter to send the text on my bot the computer does that annoying ding sound. how can I stop this from happening? Im using VB6
Returning zero (0) to KeyAscii parameter will let it know you got the message and not beep.
That worked great, thanks
Code for those that might run into same deal.
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
AddChat vbWhite, "<" & varAccount & "> ", vbCyan, Text1.text
With Packet
.InsertNTString Text1.text
.SendPacket &HE
Text1.text = ""
End With
End If
KeyAscii=0
End Sub
Just a comment:
instead of 13, you should have vbKeyEnter or vbEnter or something like that.
Not a big deal, just thought I'd mention it :)
vbKeyReturn -- Yes it's better to use constants. Makes reading your code much easier.
Quote from: iago on November 25, 2003, 08:27 PM
Just a comment:
instead of 13, you should have vbKeyEnter or vbEnter or something like that.
Not a big deal, just thought I'd mention it :)
.
Learn something new everyday - I was not aware that would work; So which is it? vbEnter or vbKeyEnter? :P
vbenter
Quote from: ObsidianWolf on November 25, 2003, 08:32 PM
vbenter
No, vbEnter = 0. He's looking for vbKeyReturn, which = 13.
whoops my bad, thanks for the correction.
Could I do the same thing with Alt? Like, vbKeyAlt? Or is it something different?
Dyndrilliac, you sure could, it would just make Alt send instead of Enter
Quote from: TriCk on November 26, 2003, 06:34 AM
Dyndrilliac, you sure could, it would just make Alt send instead of Enter
Note that alt is a modifier and doesn't have an (ASCII/Unicode) keycode of it's own.