Results 1 to 4 of 4

Thread: [2005] binding ENTER to button

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2007
    Location
    Croatia, Šibenik
    Posts
    72

    Red face [2005] binding ENTER to button

    How can I make one button to be default on one form for pressing Enter key?

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: [2005] binding ENTER to button

    Set the form's AcceptButton property to that button.
    Depending upon the purpose of your form, you may or may not also want to set the DialogResult property of the button to some value.

  3. #3
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668

    Re: [2005] binding ENTER to button

    It would probably be easier to put the code that is in your button click into it's own sub/function and then use the form keypress event to run the same code when you hit enter

    Edit: or what he ^ said
    If wishes were fishes we'd all cast nets.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Apr 2007
    Location
    Croatia, Šibenik
    Posts
    72

    Resolved Re: [2005] binding ENTER to button

    Thanks guys, problem solved.

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