MFC界面之表格下拉框
传统方法:
//方法1: CString str; GetDlgItem(IDC_COMBO_NETCARD)->GetWindowText(str); //获得组合框中的选中内容 int nChID = atoi(str); TRACE("%s", str); TRACE("%d", nChID); //方法2: int index = m_NetCard.GetCurSel();//m_NetCard为CComboBox控件关联的变量 m_NetCard.GetLBText(index, str); MessageBox(str); //方法3: int nChID = ((CComboBox*)GetDlgItem(IDC_COMBO_AIXS))->GetCurSel();
Copyright @WinkJie