Results 1 to 4 of 4

Thread: [RESOLVED] [2008] User Control Accept Button

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    263

    Resolved [RESOLVED] [2008] User Control Accept Button

    I have a user control I have created and I'm wondering how I would go about ensuring that if the user pressed the Enter key anywhere within this control that the "Search" button is clicked.

    I know Forms have an AcceptButton and CancelButton property, but it doesn't seem that user controls do. Is there a way I can get the same functionality?

    Thanks,
    jerome

  2. #2
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: [2008] User Control Accept Button

    Try handling the KeyDown event, look for the Enter keypress and then perform a click on the button when found. Also, try checking if your control or its appropriate part is focused when the key is pressed.
    Please rate helpful ppl's posts. It's the best 'thank you' you can give

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2008
    Posts
    263

    Re: [RESOLVED] [2008] User Control Accept Button

    Great, thanks.

  4. #4
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: [RESOLVED] [2008] User Control Accept Button

    You're welcome. Thanks for the rep.
    Please rate helpful ppl's posts. It's the best 'thank you' you can give

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