在vc中如何实现自动匹配编辑款.
就是在输入的时候出现下拉框选择相应的数据项.

解决方案 »

  1.   

    CComboBox::GetLBText
    int GetLBText( int nIndex, LPTSTR lpszText ) const;void GetLBText( int nIndex, CString& rString ) const;GetLBText获得指定项的文本
    nIndex 代表指定项的文本
    LPTSTR 代表一个字符串指针类型
    LPCTSTR代表一个常字符串指针类型多一个C=const
    例如:
    void CComboBoxDlg::OnBnClickedOk()
    {
    // TODO: Add your control notification handler code here
    //OnOK();
    CString str;
    m_test.GetLBText(0, str);
    AfxMessageBox(str);
    }其中m_test为ComboBox控件变量