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(); */} emiplib使用出错,求指导。。。。 OpenGL快速绘制多边形 求教大家关于多级界面的问题 为什么在onsetCursor里面调用::SetCursor不管用 如何拖动按钮 申请基础版斑竹,希望大家支持! 用ADO访问数据库时,如何拼写动态SQL 请教:有关用vc语言实现对word文档的字符串查找操作! SMTP用协议可以传输附件是声音文件的邮件吗?下面的MSDN说的uuencode是什么格式? MFC的消息机制 关于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();
*/
}