急
解决方案 »
- SetUnhandledExceptionFilter 捕捉不到线程类里的异常
- 原创:浅析棋牌游戏行业销售模式
- 神奇了!!高手来看看这个CreateFile为什么返回INVALID_HANDLE_VALUE??????
- 打开,拷贝,还原文件,急!!!!
- 一个窗口内建立几个Edit窗口(CEdit的派生内),我想让按下回车键后让焦点自动移到下
- WinXP Pro+VC6 编译说找不到CreateJobObject()函数问题求教!
- 请问这段程序该如何转换。
- 关于宏定义的一个问题
- 关于WriteProcessMemory函数的问题?
- 菜鸟送分:给我的寒假提点建议
- 怎么给应用程序增加监听端口??
- 怎么使扩展过滤名在CFileDialog对话框中分行?
AddString()
int SetCurSel( int nSelect );Return ValueThe zero-based index of the item selected if the message is successful. The return value is CB_ERR if nSelect is greater than the number of items in the list or if nSelect is set to –1, which clears the selection.ParametersnSelectSpecifies the zero-based index of the string to select. If –1, any current selection in the list box is removed and the edit control is cleared.ResSelects a string in the list box of a combo box. If necessary, the list box scrolls the string into view (if the list box is visible). The text in the edit control of the combo box is changed to reflect the new selection. Any previous selection in the list box is removed.Example// The pointer to my combo box.
extern CComboBox* pmyComboBox;// Select the last item in the combo box.
int nCount = pmyComboBox->GetCount();
if (nCount > 0)
pmyComboBox->SetCurSel(nCount-1);
int SelectString( int nStartAfter, LPCTSTR lpszString );Return ValueThe zero-based index of the selected item if the string was found. If the search was unsuccessful, the return value is CB_ERR and the current selection is not changed.ParametersnStartAfterContains the zero-based index of the item before the first item to be searched. When the search reaches the bottom of the list box, it continues from the top of the list box back to the item specified by nStartAfter. If –1, the entire list box is searched from the beginning.lpszStringPoints to the null-terminated string that contains the prefix to search for. The search is case independent, so this string can contain any combination of uppercase and lowercase letters.ResSearches for a string in the list box of a combo box, and if the string is found, selects the string in the list box and copies it to the edit control. A string is selected only if its initial characters (from the starting point) match the characters in the prefix string. Note that the SelectString and FindString member functions both find a string, but the SelectString member function also selects the string.Example// The pointer to my combo box.
extern CComboBox* pmyComboBox;
// The string to match.
extern LPCTSTR lpszmyString;// Select the item that begins with the specified string.
int nIndex = pmyComboBox->SelectString(0, lpszmyString);
ASSERT(nIndex != LB_ERR);