如果用户按下Enter wxWidgets如何获取

How to get if User pressed Enter wxWidgets

我想从字段中获取输入

wxTextCtrl* upperOnly = new wxTextCtrl(this, wxID_ANY, wxT("Test"),wxPoint(5,260), wxSize(630,30));

我希望每次用户按下 Enter

创建控件时使用wxTE_PROCESS_ENTER,即

wxTextCtrl* upperOnly = new wxTextCtrl(this, wxID_ANY, wxT("Test"),wxPoint(5,260), wxSize(630,30), wxTE_PROCESS_ENTER);

然后捕获 wxEVT_TEXT_ENTER 并在其事件处理程序中进行验证,即

upperOnly->Bind(wxEVT_TEXT_ENTER, [](wxCommandEvent&) {
        // Do something useful
     });