mfc中如何读取combobox控件中的内容
1个回答
2013-12-13
展开全部
// Dump all of the items in the combo box.
#ifdef _DEBUG CString str, str2; int n;
for (int i=0;i < pmyComboBox->GetCount();i++)
{ n = pmyComboBox->GetLBTextLen( i );
pmyComboBox->GetLBText( i, str.GetBuffer(n) );
str.ReleaseBuffer();
str2.Format(_T("item %d: %s\r\n"), i, str.GetBuffer(0));
afxDump << str2;
}#endif
查MSDN CComboBox::GetLBText
#ifdef _DEBUG CString str, str2; int n;
for (int i=0;i < pmyComboBox->GetCount();i++)
{ n = pmyComboBox->GetLBTextLen( i );
pmyComboBox->GetLBText( i, str.GetBuffer(n) );
str.ReleaseBuffer();
str2.Format(_T("item %d: %s\r\n"), i, str.GetBuffer(0));
afxDump << str2;
}#endif
查MSDN CComboBox::GetLBText
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询