Solved

textbox keypress event beeping ?!?!?!

Posted on 2007-03-20
3
447 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 250 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

729 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