Link to home
Start Free TrialLog in
Avatar of Sjaaksken
Sjaaksken

asked on

textbox: add text to listbox when the enter key is pressed

Hi,

I have a reasonably easy question but can't seem to get it right:

I have a textbox in my form (textBox1), when the enter key is pressed it should enter the text in the textbox in a listbox(listBox1)

How can i make it enter the text in the listbox (once for every enter pressed)?
ASKER CERTIFIED SOLUTION
Avatar of Bruce_1975
Bruce_1975

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sjaaksken
Sjaaksken

ASKER

Hi, thanks for the reply,

apparently I was close but when I did paste your solution and ran the program it didn't enter the text when the enter key was pressed. I tried assigning other keys to the 'if' statement but same result.

Am I forgetting something? It also doesn't clear the textbox as it doesnt seem to accept the enter action
I think you solved the problem. If you still have problems, just let me know.

Regards,
Bruce