VB.NET

Moderators: seancampbell
Number of threads: 4022
Number of posts: 10035

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Beep whenever i press ENTER on a textbox Posted by dalvarezmtz on 3 Dec 2004 at 3:07 PM
Dudes!! help please!!
i have 2 textboxes...the first one gets focused to the second one.. and the second one fires a function... but everytime i get the ENTER key pressed sounds an annoying beep...

how can i get rid of it!!??

here is my code folks... hope someone knows...<<<
Private Sub txtfrecval_Keydown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtfrecval.KeyDown
If e.KeyCode = Keys.Enter Then
Me.txtvalfrec.Focus()
e.Handled = True
End If
End Sub
Private Sub txtvalfrec_Keydown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtvalfrec.KeyDown
If e.KeyCode = Keys.Enter Then
Me.frecuencias()
txtfrecval.Clear()
txtvalfrec.Clear()
txtfrecval.Focus()
e.Handled = True
End If
Report
Re: Beep whenever i press ENTER on a textbox Posted by Baldusarius on 3 Dec 2004 at 10:07 PM
The easiest fix is to handle the KeyPress event instead of KeyDown.

: Dudes!! help please!!
: i have 2 textboxes...the first one gets focused to the second one.. and the second one fires a function... but everytime i get the ENTER key pressed sounds an annoying beep...
:
: how can i get rid of it!!??
:
: here is my code folks... hope someone knows...<<<
: Private Sub txtfrecval_Keydown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtfrecval.KeyDown
: If e.KeyCode = Keys.Enter Then
: Me.txtvalfrec.Focus()
: e.Handled = True
: End If
: End Sub
: Private Sub txtvalfrec_Keydown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtvalfrec.KeyDown
: If e.KeyCode = Keys.Enter Then
: Me.frecuencias()
: txtfrecval.Clear()
: txtvalfrec.Clear()
: txtfrecval.Focus()
: e.Handled = True
: End If
:

Report
Re: Beep whenever i press ENTER on a textbox Posted by kainsworth on 8 Dec 2004 at 4:30 AM
: The easiest fix is to handle the KeyPress event instead of KeyDown.
:


And don't forget to change from KeyCode to KeyChar when you do

Private Sub QuickLocateTextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles QuickLocateTextBox.KeyPress
If e.KeyChar = Chr(13) Then
e.Handled = True
End If
End Sub

Ged



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.