Discussion in 'Basic4ppc Wishlist' started by pmu5757, Mar 21, 2008.

  1. pmu5757

    pmu5757 Member Licensed User

    Hello !
    First, excuse the poor english of a frenchy...

    I'm making a program that ask questions to the user.
    The user must type the answer in a textbox, and then click an OK button to check if the answer is right or not.
    To make the answer easier to type, I've set the focus on the answer textbox.
    But it's impossible for the user to type enter instead ok clicking ok because the focus is not on the ok button.
    Does it exist a solution to make it possible ?

    Thank you

    Last edited: Mar 21, 2008
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can use a code similar to:
    Sub App_Start
    End Sub

    Sub TextBox1_KeyPress (key)
    If Asc(key) = 13 Then 
    End If
    End Sub

    Sub Button1_Click
    End Sub
    TextBox1 should be a MultiLine textbox.
  3. pmu5757

    pmu5757 Member Licensed User

    It works very well, thank you.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice