Author | Message | Time |
---|---|---|
ObsidianWolf | 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 | November 26, 2003, 2:16 AM |
Spht | Returning zero (0) to KeyAscii parameter will let it know you got the message and not beep. | November 26, 2003, 2:18 AM |
ObsidianWolf | That worked great, thanks Code for those that might run into same deal. [code] 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 [/code] | November 26, 2003, 2:26 AM |
iago | 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 :) | November 26, 2003, 2:27 AM |
Spht | vbKeyReturn -- Yes it's better to use constants. Makes reading your code much easier. | November 26, 2003, 2:28 AM |
Dyndrilliac | [quote author=iago link=board=17;threadid=3852;start=0#msg31526 date=1069813627] 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 :) [/quote]. Learn something new everyday - I was not aware that would work; So which is it? vbEnter or vbKeyEnter? :P | November 26, 2003, 2:29 AM |
ObsidianWolf | vbenter | November 26, 2003, 2:32 AM |
Spht | [quote author=ObsidianWolf link=board=17;threadid=3852;start=0#msg31532 date=1069813955] vbenter [/quote] No, vbEnter = 0. He's looking for vbKeyReturn, which = 13. | November 26, 2003, 2:35 AM |
ObsidianWolf | whoops my bad, thanks for the correction. | November 26, 2003, 2:40 AM |
Dyndrilliac | Could I do the same thing with Alt? Like, vbKeyAlt? Or is it something different? | November 26, 2003, 2:41 AM |
TriCk | Dyndrilliac, you sure could, it would just make Alt send instead of Enter | November 26, 2003, 12:34 PM |
Skywing | [quote author=TriCk link=board=17;threadid=3852;start=0#msg31620 date=1069850072] Dyndrilliac, you sure could, it would just make Alt send instead of Enter [/quote] Note that alt is a modifier and doesn't have an (ASCII/Unicode) keycode of it's own. | November 26, 2003, 2:26 PM |