在窗体中设置一个ComboBox,一个ListBox,一个Button,并在Member Variables中添加变量m_Combo1和m_List1。
运行程序,在选择了ComboBox中的一个值时,按Button可将ComboBox选择的值传递到ListBox中去。
不知道如何写这个OnButton

解决方案 »

  1.   

    可以用combobox的getcursel来取得值吧
      

  2.   

    int nIndex;
    CString strText;
    nIndex=m_Combo1.GetCurSel();
    strText=m_Combo1.GetLBText(nIndex,strText);
    这样就可以了吧!!
      

  3.   

    写错了
    int nIndex; 
    CString strText; 
    nIndex=m_Combo1.GetCurSel(); 
    m_Combo1.GetLBText(nIndex,strText); 
      

  4.   

    int nIndex; 
    CString strText; 
    nIndex=m_Combo1.GetCurSel(); 
    m_Combo1.GetLBText(nIndex,strText);行了,再调用m_List1.AddString(strText);谢谢楼上的两位