Textbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daveftl
    New Member
    • Jan 2007
    • 43

    Textbox

    Can you help me have a code of a textbox that doesnt need a command button to execute it...like for example when entering a password to a textbox and wen i press enter it will execute the LOGIN command and i dont have to click the LOGIN command button. thanks and GOD bless!
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by daveftl
    Can you help me have a code of a textbox that doesnt need a command button to execute it...like for example when entering a password to a textbox and wen i press enter it will execute the LOGIN command and i dont have to click the LOGIN command button. thanks and GOD bless!
    Probably the simplest would be to turn on the KeyPreview property of the form, and then handle the action in the Form_KeyPress or Form_KeyDown event. Either that, or handle it in the KeyPress event for the Textbox, I suppose.

    Unless you're talking about VB.Net, in which case I have no idea how it works.

    Comment

    • daveftl
      New Member
      • Jan 2007
      • 43

      #3
      Thanks a lot! God bless...

      Comment

      • dwadish
        New Member
        • Nov 2006
        • 129

        #4
        it is very simple and you can use it with textbox's Keypress event.

        Code:
        if key ascii =13 then
        
        if password.text= " wich data youwant to check" then
        form.show  "or what would yoy like to act"
        else
        msgbox "invalid"
        endif
        endif

        Comment

        Working...