Hey,
How can I make it so that when you hit enter when your typing in a text box that it unloads the form? thx
Printable View
Hey,
How can I make it so that when you hit enter when your typing in a text box that it unloads the form? thx
If I was using your program I would be surprised and probably annoyed if it did that.
Like:
VB Code:
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Unload Me End Sub
Maybe he is unloading cause the user has done what they should :):)
Bruce.
That certainly wouldn't be one of the standard ways of doing it.:)Quote:
Originally posted by Bruce Fox
Like:
VB Code:
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then Unload Me End Sub
Maybe he is unloading cause the user has done what they should :):)
Bruce.
Here is a potential use.
A (custom made) password dialog (Form). If after entering the correct password
the user hits Return, (being valid) the form could disapear (remain if password incorrect). Maybe :)
Just for an afterthought you can set a command button to be a default OK button. When you press enter anywhere on the form, it will in effect click the button. You can also use a Cancel property to do the same with the Esc key.
lol, My program is a browser and when enter is pressed the url in a text box loads the web thingy and so on...i just used unload cuz i didnt have time to say web.navigate = "url" :D
Thx