CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Posts
    42

    how to trap enter key??

    hi guys. can someone help me with my problem? I'm trying to trap or capture the enter or return key if the user press it on the combo box? Can some one teach me how to trap ernte key or return key on the the combo box..

    thanks...
    BandiT

  2. #2
    Join Date
    Nov 2002
    Location
    Baby Land
    Posts
    646

    Re: how to trap enter key??

    Code:
    private void comboBox1_KeyDown(object sender, KeyEventArgs e)
    {
                if (e.KeyCode == Keys.Enter)
                {
                    Debug.WriteLine("enter");
                }
    }
    but beware when enter key is pressed while the combobox dropdown portion is opened, the key down event will be fired twice.

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

Featured