MFC界面之表格下拉框
时间:2021-09-12 11:53:53
收藏:0
阅读:51
传统方法:
//方法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();
原文:https://www.cnblogs.com/WinkJie/p/15253602.html
评论(0)