0

I have been trying to capture the enter key in a windows.net textbox but i have no idea how to do it, i googled searched but the only examples i find are visualbasic and c# ones and when i try to do thesame thing in c++ in doesnt work.

I am using visual c++ express 2008 and i am working with windows forms(.net)
I hope thats enough information for you guys to be able to help me.
Thanks in advanced.

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by Martje
0

Do you want to capture it in place of a button press (like you would in an instant messenger) or...? What were the instructions in C#, perhaps there's a property of the form that's called something different. There's a property where the keypresses from the textbox are also passed down to the form, but I forgot what that one is called.

0

Yes i want to capture it in place of a button press (like you would in an instant messenger)

0

Make sure AcceptsEnter is false for the textbox(it is by default). Make a keyDown event for the textbox. Within that event handler have something like

if(e->KeyCode == Keys::Enter)
    button1->PerformClick();

or whatever action you need to take.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.