I have created a small program that accepts a name from a one line wxTextCtrl. I have a button next to it with a function to accept the input from the wxTextCtrl when clicked. When I enter text in the box and press Enter, it just moves the focus to the button.
How can I set it up so that pressing Enter will go to the function to accept the input instead of just moving the focus?
accepting "Enter" from a wxTextCtrl Topic is solved
-
- Earned some good credits
- Posts: 102
- Joined: Thu Dec 28, 2006 5:12 pm
- Location: Indiana, US
Be sure you create your wxTextCtrl with the wxTE_PROCESS_ENTER style, then add this:
To your EVENT_TABLE, of course changing the ID to your textctrl's ID and the function to whatever function you need.
Code: Select all
EVT_TEXT_ENTER(ID_TEXTCTRL, myFrame::OnEnter)
-
- Earned some good credits
- Posts: 102
- Joined: Thu Dec 28, 2006 5:12 pm
- Location: Indiana, US