How to get text in ComboBox
-
Hi, all I created a Dropdown ComboBox. now I want to handle the CBN_EDITCHANGE message. At that time, how can I get the text in the editbox of the combobox box? I know one way is to use UpdateData, but it will update all the data include other controls, how can I just get the text of the combobox? Thanks in advance
-
Hi, all I created a Dropdown ComboBox. now I want to handle the CBN_EDITCHANGE message. At that time, how can I get the text in the editbox of the combobox box? I know one way is to use UpdateData, but it will update all the data include other controls, how can I just get the text of the combobox? Thanks in advance
if MFC: int CComboBox::GetLBText( int nIndex, LPTSTR lpszText ) const; void CComboBox::GetLBText( int nIndex, CString& rString ) const; if Win32: CBN_EDITCHANGE idComboBox = (int) LOWORD(wParam); // identifier of combo box hwndComboBox = (HWND)lParam; // handle to combo box So: use ::GetWindowText with the window handle as the Handle of the combobox, hope this help Papa while (TRUE) Papa.WillLove ( Bebe ) ;