vb.net - How can to stop the "ding" sound while pressing enter -


i need stop "ding" sound while pressing enter use send message. there code:

    private sub textbox2_keydown(sender object, e system.windows.forms.keyeventargs) _  handles textbox2.keydown     if e.keycode = keys.enter         textbox3.readonly = true         if textbox2.text = ("")         else             dim postdata = "token=" & textbox1.text & "&msg=" & textbox3.text & ": " & textbox2.text             dim request webrequest = webrequest.create("http://url.com/msg.php")              request.method = "post"             dim bytearray byte() = encoding.utf8.getbytes(postdata)             request.contenttype = "application/x-www-form-urlencoded"             request.contentlength = bytearray.length             dim datastream stream = request.getrequeststream()             datastream.write(bytearray, 0, bytearray.length)             datastream.close()             dim response webresponse = request.getresponse()             datastream = response.getresponsestream()             dim reader new streamreader(datastream)             dim responsefromserver string = reader.readtoend()             reader.close()             datastream.close()             response.close()             textbox2.clear()         end if     end if end sub 

i'm using sound notify when textbox changed textbox2 sending messages , when sends using enter "ding" plays , other sound together.

try setting e.handled , e.suppresskeypress true.

private sub textbox2_keydown(sender object, e keyeventargs) handles textbox2.keydown     if e.keycode = keys.enter         ' code...          e.handled = true         e.suppresskeypress = true     end if end sub 

this should suppress "ding".


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -