Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

textbox keypress event beeping ?!?!?!

Posted on 2007-03-20
3
Medium Priority
?
449 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 1000 total points
ID: 18757233
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
ID: 18757474
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 86

Expert Comment

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

618 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