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 »

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: 469
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 »

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 »

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: 7467
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 »

Yes.
Post Reply