User forums > General (but related to Code::Blocks)

Combobox cannot capture the Enter command.

<< < (2/2)

Miguel Gimenez:
You have not checked wxTE_PROCESS_ENTER in the combobox style (I asked you explicitly about this):

--- Code: ---CmdBox = new wxComboBox(wxp1, ID_COMBOBOX1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_COMBOBOX1"));
--- End code ---
should be

--- Code: ---CmdBox = new wxComboBox(wxp1, ID_COMBOBOX1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, 0, wxTE_PROCESS_ENTER, wxDefaultValidator, _T("ID_COMBOBOX1"));
--- End code ---

Goto wxSmith and check it.

EDIT: extract fom the tutorial you were following;

--- Quote ---You may notice that nothing happens when you press Enter in CmdBox. That is because we have to set CmdBox to handle that event. Select this control in Code::Blocks Resources window, then in Properties open Style section and check wxTE_PROCESS_ENTER. Now it's working as expected.

--- End quote ---

cyuyan:
Thank you very much!

Navigation

[0] Message Index

[*] Previous page

Go to full version