Solved

textbox keypress event beeping ?!?!?!

Posted on 2007-03-20
3
427 Views
Last Modified: 2008-01-09
I have two panels:   one being a search panel & one holding a datagrid.

I have put a keypress event on the one text field ....

Private Sub txtIDnum_KeyPress(ByVal sender As System.Object,
                                                    ByVal e As System.Windows.Forms.KeyPressEventArgs)
                                                    Handles txtIDnum.KeyPress
        If e.KeyChar = Chr(13) Then
            PerformCustomerSearch()
        End If
End Sub

When I press the Enter key, the customer search works fine, but its beeping as if it's erroring out somewhere.   If I press the Search button though, no beeps.  

The odd thing is that on my "login" form, I do the very same thing and I have no problem ... the only difference is that when i do the keypress event on the login form, all it does is close that one and open the main form whereas the even i'm having trouble with just populates and displays a datagrid on a different panel.  

Any help would be greatly appreciated!  :)

- Travis -
0
Comment
Question by:trs28
  • 2
3 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 250 total points
Comment Utility
To get rid of the Beep...set e.Handled = True:

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

Author Comment

by:trs28
Comment Utility
That did it!   Thanks!   ....but why does it beep there, but not when I try to trap that key on the login dialog I'm using?!?
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
Comment Utility
Maybe because you close that form?...not really sure though.  =\
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now