How to call a function when pressing enter in the textctrl Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
lpx
Earned a small fee
Earned a small fee
Posts: 12
Joined: Sun Aug 13, 2017 4:54 am

How to call a function when pressing enter in the textctrl

Post by lpx » Sun Aug 20, 2017 4:20 am

I want to call a function when I presses enter in the textcrtl, there should be a function called "onenterpress...", but I can't find this function. Can anyone teach me how to do it?

New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 313
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: How to call a function when pressing enter in the textctrl

Post by New Pagodi » Sun Aug 20, 2017 5:03 am

Create the control with a style including wxTE_PROCESS_ENTER and then handle the wxEVT_TEXT_ENTER event.

lpx
Earned a small fee
Earned a small fee
Posts: 12
Joined: Sun Aug 13, 2017 4:54 am

Re: How to call a function when pressing enter in the textctrl

Post by lpx » Mon Aug 21, 2017 3:59 am

New Pagodi wrote:Create the control with a style including wxTE_PROCESS_ENTER and then handle the wxEVT_TEXT_ENTER event.
Thanks for replying. I read the class reference and it's helpful. I solve the problem by connecting the function and the event, that is what the handling means right?
Thanks.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3568
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How to call a function when pressing enter in the textctrl

Post by ONEEYEMAN » Mon Aug 21, 2017 2:50 pm

Yes.

Post Reply