CComboBox::FindStringExact 查找(组合框中)与指定字符串匹配的第一个列表框字符串。 CComboBox::GetComboBoxInfo 检索有关 CComboBox 对象的信息。 CComboBox::GetCount 检索组合框的列表框中的项数。 CComboBox::GetCueBanner 获取为组合框控件显示的提示文本。 CComboBox::GetCurSel 检索组合框的列表框中当前所选项(...
CComboBox::FindStringExact 项目 2013/03/01 本文内容 参数 返回值 备注 示例 显示另外 2 个 调用FindStringExact 成员函数找到第一个列表框字符串(在组合框)匹配一 lpszFind指定的字符串。复制 int FindStringExact( int nIndexStart, LPCTSTR lpszFind ) const; ...
If the combo box was created with an owner-draw style but without theCBS_HASSTRINGSstyle,FindStringExactattempts to match the doubleword value against the value of lpszFind. Example c++คัดลอก // The string to match.LPCTSTR lpszmyExactString = _T("item 5");// Delete all...
如果你知道要选择的项的关键字,你可以首先使用FindStringExact或FindString方法找到该关键字的索引,然后使用SetCurSel设置它。 cpp int nIndex = m_comboBox.FindStringExact(-1, _T("关键字")); if (nIndex != CB_ERR) { m_comboBox.SetCurSel(nIndex); } 如果需要,更新界面以反映新的默认值: 通常,调...
CComboBox::FindStringExact Finds the first list-box string (in a combo box) that matches the specified string. CComboBox::GetComboBoxInfo Retrieves information about the CComboBox object. CComboBox::GetCount Retrieves the number of items in the list box of a combo box. CComboBox::GetCueBanner...
intnIndexTop = ((CComboBox *)GetDlgItem(IDC_COMBO_TEST))->GetTopIndex(); // 获取相应字符串的下标 intnIndex = ((CComboBox *)GetDlgItem(IDC_COMBO_TEST))->FindStringExact(0,"香蕉"); // 获取当前选中项的内容 intnIndexCurItem = ((CComboBox *)GetDlgItem(IDC_COMBO_TEST))->GetCurSel(); ...
int nIndex = m_cbExample.FindStringExact( nStartAfter, “value to be found”); nStartAfter指明从哪一行开始查找。如果查找成功,返回的是该项的位置;否则,返回CB_ERR。 也可以选中包含指定字符串的项,如: int nIndex = m_cbExample.SelectString( nStartAfter, “value to be selected”); ...
请参阅 CComboBox::FindString, CB_FINDSTRINGEXACT CComboBox::GetCount int GetCount( ) const; 返回值 返回项的个数。该值比最后一项的下标要大1(因为下标是从0开始计算的)。出错时返回CB_ERR。 说明 本函数用于取得组合框中列表框中项的个数。 请参阅 CB_GETCOUNT CComboBox::GetCurSel int GetCursor( )...
FindStringExact(-1, "OFF"); m_cbData.SetCurSel(iIndex); 但是,请注意,FindStringExact的文档表示搜索不区分大小写。但SelectString (默认行为)更糟糕。 解决所有这些问题的另一种方法是使用SetWindowText并这样做。这样,列表框组件中的内容就无关紧要了。例: 代码语言:javascript 复制 m_cbData.SetWindowText...
CComboBox:: FindString Localiza a primeira cadeia de caracteres que contém o prefixo especificado na caixa de listagem de uma caixa de combinação. CComboBox::FindStringExact Localiza a primeira cadeia de caracteres da caixa de listagem (em uma caixa combo) que corresponde a cadeia de carac...