sjn78 Posted October 11, 2003 Posted October 11, 2003 I have a small form with a single textbox for data entry. I have got it so when you hit escape it closes the form. Using the below code, the system 'BEEPS' when this is done. How can I do this so there is no 'BEEP' Private Sub frmAddResult_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress If Asc(e.KeyChar) = 27 Then GC.Collect() Me.Close() End If End Sub Thanks Steve Quote
Leaders dynamic_sysop Posted October 11, 2003 Leaders Posted October 11, 2003 try e.Handled and see if it stops the beep, i'm not at home so cant test it out but it works for Keys.Enter If Asc(e.KeyChar) = 27 Then GC.Collect() Me.Close() e.Handled = True '/// stop the Beep. End If Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.