VC中如何实现在列表框中读取文本内容 如题,小弟是菜鸟,请高手指点 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CComboBox::GetLBTextint GetLBText( int nIndex, LPTSTR lpszText ) const;void GetLBText( int nIndex, CString& rString ) const; 给你的列表框关联一个变量CComboBox m_ComboBox;CString strText;m_ComboBox.GetLBText(0,strText);//得到下拉框的第一项的字符串 void CDemoDlg::OnCbnSelchangeCombo1(){ // TODO: 在此添加控件通知处理程序代码 CString strText; int nIndex =m_ComboBox.GetCurSel(); m_ComboBox.GetLBText(nIndex,strText); //或者 /* CString strText; m_ComboBox.GetWindowText(strText.GetBuffer(100),100); strText.ReleaseBuffer(); */} 在网络吃紧的情况,recv 第三个参数的问题? 求助~在线等~怎样用windbg 确认某个object是否是signal状态的 如何从一个网页上提取一个表格的内容? MFC的选项卡控件怎么使用啊? 如何在宏中使用RGB? 一个复制目录的函数 初学问题100分,接口属性内部调用 ADO,ACCESS的问题 如果写一个远程登陆程序? CButton::DrawItem()的问题 关于font自绘问题 CButtonST 按钮按下时的问题
int GetLBText( int nIndex, LPTSTR lpszText ) const;void GetLBText( int nIndex, CString& rString ) const;
CComboBox m_ComboBox;
CString strText;
m_ComboBox.GetLBText(0,strText);//得到下拉框的第一项的字符串
void CDemoDlg::OnCbnSelchangeCombo1()
{
// TODO: 在此添加控件通知处理程序代码
CString strText;
int nIndex =m_ComboBox.GetCurSel();
m_ComboBox.GetLBText(nIndex,strText);
//或者
/*
CString strText;
m_ComboBox.GetWindowText(strText.GetBuffer(100),100);
strText.ReleaseBuffer();
*/
}