CComboBox::GetLBText int GetLBText( int nIndex, LPTSTR lpszText ) const;void GetLBText( int nIndex, CString& rString ) const;Return ValueThe length (in bytes) of the string, excluding the terminating null character. If nIndex does not specify a valid index, the return value is CB_ERR.ParametersnIndexContains the zero-based index of the list-box string to be copied.lpszTextPoints to a buffer that is to receive the string. The buffer must have sufficient space for the string and a terminating null character.rStringA reference to a CString.
是在dialog里用的吧?在class iew里就可以加个变量的
CString text;
m_box.GetWindowText(text);//这个字符串就是你下拉框中的文字。
CString text;UpdateData(TRUE);
m_box.GetWindowText(text);
CComboBox m_box;
CString text;UpdateData(TRUE);
然后把与控件关联的text随便传给别的变量就可以用了
int GetLBText( int nIndex, LPTSTR lpszText ) const;void GetLBText( int nIndex, CString& rString ) const;Return ValueThe length (in bytes) of the string, excluding the terminating null character. If nIndex does not specify a valid index, the return value is CB_ERR.ParametersnIndexContains the zero-based index of the list-box string to be copied.lpszTextPoints to a buffer that is to receive the string. The buffer must have sufficient space for the string and a terminating null character.rStringA reference to a CString.
rString//是一个CString对象的引用,用来存储返回值。