⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_43383.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:43383 发表者:Rikcuo Akira 发表日期:2003-06-10 19:20:04
<br>主题:CCombo有沒將所有Item移除的函數
<br>内容:CCombo有沒將所有Item移除的函數,我找過了msdn卻沒找到
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:擎天柱 回复日期:2003-06-10 19:38:31
<br>内容:没有。<BR>// The pointer to my combo box.<BR>extern CComboBox* pmyComboBox;<BR><BR>// Delete every other item from the combo box.<BR>for (int i=0;i &lt; pmyComboBox-&gt;GetCount();i++)<BR>{<BR>&nbsp;&nbsp; pmyComboBox-&gt;DeleteString( i );<BR>}<BR>使用循环吧!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:忧河 回复日期:2003-06-12 09:32:56
<br>内容:有的,下面这个函数就是实现这个功能!<BR>CComboBox::ResetContent<BR>void ResetContent( );<BR><BR>Remarks<BR><BR>Removes all items from the list box and edit control of a combo box.<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:Rikcuo Akira 回复日期:2003-06-13 23:06:02
<br>内容:C:\tmp\Exchange\CountDlg.cpp(1134) : error C2039: 'ResetContent' : is not a member of 'CListCtrl'<BR><BR>我試過,卻出現以上訊息..<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:Rikcuo Akira 回复日期:2003-06-13 23:12:27
<br>内容:extern CComboBox* pmyComboBox;<BR><BR>// Delete every other item from the combo box.<BR>for (int i=0;i &lt; pmyComboBox-&gt;GetCount();i++)<BR>{<BR>&nbsp;&nbsp; pmyComboBox-&gt;DeleteString( i );<BR>}<BR><BR>至於這個應該是pmyComboBox-&gt;DeleteString( 0 );<BR>因為每刪除一個Item,index就從新排過一次(從0開始)
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:忧河 回复日期:2003-06-19 15:11:52
<br>内容:我得程序中所采用得ComboBox,关于删除所有得记录的确采用了ResetContent<BR>而且,msdn中也详细得说明了这个函数:<BR>-----------------------<BR>CComboBox::ResetContent<BR>void ResetContent( );<BR><BR>Remarks<BR><BR>Removes all items from the list box and edit control of a combo box.<BR><BR>--------------------------<BR><BR>不过ResetContent 不是ListCtrl得函数,如果要删除ListCtrl得函数,则采用DeleteAllItem()<BR><BR><BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -