• Welcome to Valhalla Legends Archive.
 

[VB]Stopping Beep

Started by blinkdude, July 11, 2003, 12:43 AM

Previous topic - Next topic

blinkdude

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
<Total-Assault@Azeroth> WTF IS THIS CLAN A BUNCH OF NERDS?
<Yoni[vL]@Azeroth> Yes.
<Grok> Yes.
<[vL]Kp> You sound surprised.
<Total-Assault> at least they admit it
&

Soul Taker

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

blinkdude

thx for trying to help but it still dings :/
<Total-Assault@Azeroth> WTF IS THIS CLAN A BUNCH OF NERDS?
<Yoni[vL]@Azeroth> Yes.
<Grok> Yes.
<[vL]Kp> You sound surprised.
<Total-Assault> at least they admit it
&

Stealth

As long as the variable KeyAscii is 0 when the subroutine finishes, it won't ding. :\
- Stealth
Author of StealthBot

blinkdude


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 =[
<Total-Assault@Azeroth> WTF IS THIS CLAN A BUNCH OF NERDS?
<Yoni[vL]@Azeroth> Yes.
<Grok> Yes.
<[vL]Kp> You sound surprised.
<Total-Assault> at least they admit it
&

SNiFFeR

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

blinkdude

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
<Total-Assault@Azeroth> WTF IS THIS CLAN A BUNCH OF NERDS?
<Yoni[vL]@Azeroth> Yes.
<Grok> Yes.
<[vL]Kp> You sound surprised.
<Total-Assault> at least they admit it
&

iago

You shouldn't in visual basic.. you only need brackets in an "if"in c++.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Camel

#8
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