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

📄 subject_57002.htm

📁 vc
💻 HTM
字号:
<p>
序号:57002 发表者:木木二中 发表日期:2003-10-22 11:21:58
<br>主题:ListBox怎么设置多列?
<br>内容:ListBox怎么设置多列?怎么在多列的ListBox里添加?
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:浪际天涯 回复日期:2003-10-22 11:28:02
<br>内容:为什么不用ListCtrl呢?不过好像ListBox也有设置多列的,但我没用过
<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-10-22 14:11:19
<br>内容:有个属性是Multi Column吧,勾选就可以了
<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-10-22 19:00:14
<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-10-23 08:56:48
<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-10-23 09:07:01
<br>内容:listbox-&gt;属性-&gt;styles-&gt;view-&gt;report<BR>CListCtrl m_cListZipin<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; m_cListZipin.InsertColumn(0,_T(&#34;No&#34;),LVCFMT_LEFT,100);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.InsertColumn(1,_T(&#34;Unicode&#34;),LVCFMT_LEFT,120);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.InsertColumn(2,_T(&#34;CJK+code&#34;),LVCFMT_LEFT,100);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.InsertColumn(3,_T(&#34;Hanzi&#34;),LVCFMT_LEFT,100);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.InsertColumn(4,_T(&#34;字次&#34;),LVCFMT_LEFT,100);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.InsertColumn(5,_T(&#34;覆盖率%%&#34;),LVCFMT_LEFT,100);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.InsertColumn(6,_T(&#34;累加覆盖率%&#34;),LVCFMT_LEFT,120);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.InsertColumn(7,_T(&#34;部首编号&#34;),LVCFMT_LEFT,100);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.InsertColumn(8,_T(&#34;部首&#34;),LVCFMT_LEFT,100);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.InsertColumn(9,_T(&#34;部外笔画数&#34;),LVCFMT_LEFT,120);<BR>int index;<BR><BR>int nItem=m_cListZipin.InsertItem(index,(_bstr_t)vNO);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.SetItem(nItem,1,1,(_bstr_t)vUcode,NULL,0,0,0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.SetItem(nItem,2,1,(_bstr_t)vCjk,NULL,0,0,0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.SetItem(nItem,3,1,(_bstr_t)vHanzi,NULL,0,0,0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.SetItem(nItem,4,1,(_bstr_t)vZici,NULL,0,0,0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.SetItem(nItem,5,1,(_bstr_t)str_wfb,NULL,0,0,0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.SetItem(nItem,6,1,(_bstr_t)vAddwfb,NULL,0,0,0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.SetItem(nItem,7,1,(_bstr_t)vRadno,NULL,0,0,0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.SetItem(nItem,8,1,(_bstr_t)vRad,NULL,0,0,0);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m_cListZipin.SetItem(nItem,9,1,(_bstr_t)vStroke,NULL,0,0,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>
回复者:木木二中 回复日期:2003-10-23 09:30:01
<br>内容:你所说的是ListCtrl吧,我是说ListBox。<BR>我下别人的程序看了下,好像是通过owendraw出来的。<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>
<font color=red>答案被接受</font><br>回复者:下次用什么名字? 回复日期:2003-10-23 09:39:53
<br>内容:ListBox的多列和ListCtrl的多列意思不一样,<BR>ListBox你AddString就可以了,假如你的ListBox不高,只能显示10行,而你AddString了11行,第11行就会自动在换到下一列显示,这与ListCtrl的多列概念不一样<BR>如果你要多列,每列的保存不同的内容,如5楼那般,就要用ListCtrl<BR>ListCtrl的用法5楼说了,我再说一次:)<BR>假如3列:<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl=&amp;GetListCtrl();//如果你是自己画的控件就不必了<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl-&gt;ModifyStyle(NULL,LVS_REPORT+LVS_EDITLABELS);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl-&gt;SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl-&gt;ShowWindow(SW_SHOW);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl-&gt;InsertColumn(0,&#34;序号&#34;,LVCFMT_LEFT,36);&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl-&gt;InsertColumn(1,&#34;类目代码&#34;,LVCFMT_LEFT,60);&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl-&gt;InsertColumn(2,&#34;合同号&#34;,LVCFMT_LEFT,140);<BR>假如3行:<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl-&gt;InsertItem(0,&#34;0&#34;);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl-&gt;InsertItem(1,&#34;1&#34;);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl-&gt;InsertItem(2,&#34;2&#34;);<BR>添加单元格内容:<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl-&gt;SetItemText(0,1,&#34;单元格的内容&#34;);<BR><BR>注意这里说的是ListCtrl,至于ListBox,你就AddString好了
<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-10-23 09:48:52
<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 + -