Results 1 to 6 of 6

Thread: Key Supression

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 1999
    Posts
    49

    Key Supression

    I have a combobox that I want the user to be able to type into and then press enter to call a method. My only problem is that when the user presses enter, a *ding* noise plays. I have tried setting 'e.handled = true' but that is not working for some reason. Does anyone have any ideas on getting rid of the *ding*?

    Thanks!

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Try this
    VB Code:
    1. Private Sub ComboBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles
    2. ComboBox1.KeyPress
    3.         If Asc(e.KeyChar()) = 13 Then
    4.             e.Handled = True
    5.         End If
    6. End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 1999
    Posts
    49
    Nope. Still same problem.

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    . I can't believe that . I always use that to stop the ding sound .

  5. #5

    Thread Starter
    Member
    Join Date
    Jan 1999
    Posts
    49
    Does another property need to be set somewhere first?

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by Cmathis
    Does another property need to be set somewhere first?
    no , just throw a combobox and add that code in the Keypress event .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width