问题如题:组合框既可以从下拉列表中选,又可以输入,从下拉列表中选我知道在OnSelchang中用下面语句实现
void CAddItemDlg::OnSelchangeAddbo2()
{
// TODO: Add your control notification handler code here
int nIndex = m_objbox.GetCurSel();
m_objbox.GetLBText(nIndex,m_ObjName);
}可我不知道怎么取得直接输入的数据?
void CAddItemDlg::OnSelchangeAddbo2()
{
// TODO: Add your control notification handler code here
int nIndex = m_objbox.GetCurSel();
m_objbox.GetLBText(nIndex,m_ObjName);
}可我不知道怎么取得直接输入的数据?
或映射变量(classwizard)
CString str;
GetDlgItem(IDC_COMBOX)->GetWindowText(str);2
Ctrl + W 打开类向导 给IDC_COMBOX映射一个变量
UpdateData();//把控件的值提交到你映射的变量
GetDlgItem(IDC_COMBO1)->GetWindowText(str);