Results 1 to 3 of 3

Thread: Button click on enter?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    210

    Button click on enter?

    All programs except mine seems to have the same event when clicking the OK or confirmative button and when pressing the enter key.

    How can I have mine to do that too?
    Is it a keypress function?

  2. #2
    Addicted Member Fat_N_Furry's Avatar
    Join Date
    Oct 2002
    Posts
    171
    Select your form, and change the AcceptButton property (under the Misc section) to whatever button you want to be pressed when the user hits Enter.


    gL!
    Furry
    Eat long and prosper!
    If someone helps you, find someone you can help.
    If you still have time, click on the darn banner up there and help the forum!

  3. #3
    Hyperactive Member
    Join Date
    Jun 2002
    Location
    midewest u.s.
    Posts
    275
    If I understand your question correctly, you want to have a textbox click a button when the user presses enter?

    If that is the case you can do it with code in the KeyDown event like this...

    Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown

    If (e.KeyCode = Keys.Enter) Then _
    Call Button1_click(sender, e)

    End Sub


    hope that helps

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