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

📄 subject_58171.htm

📁 vc
💻 HTM
字号:
<p>
序号:58171 发表者:gaojie 发表日期:2003-10-30 14:49:43
<br>主题:着急,关于CListCtrl的,请大虾指点!1
<br>内容:我要在视图中显示一个CListCtrl,&nbsp;&nbsp;&nbsp;&nbsp;代码如下:m_ListCtrl.Create(WS_CHILD|WS_VISIBLE|WS_BORDER|LVS_REPORT,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rect, this, 1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl.InsertColumn(0,&#34;房间号码&#34;, LVCFMT_LEFT, 215);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl.InsertColumn(1,&#34;电话号码&#34;, LVCFMT_LEFT, 215);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl.InsertColumn(2, &#34;客房状态&#34;, LVCFMT_LEFT, 215);<BR>可是显示出来的CListCtrl有四列,为什么?
<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-30 15:11:45
<br>内容:那第四列有标题吗?没有就不是第四列,只是你的列表宽度超过215*3而已<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>
<font color=red>答案被接受</font><br>回复者:redleaf 回复日期:2003-10-30 15:21:47
<br>内容:可以首先得到ListCtrl的宽度,然后让他正好显示三列<BR><BR>CRect rt;<BR>m_ListCtrl.GetClientRect(&amp;rt);<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl.InsertColumn(0,&#34;房间号码&#34;, LVCFMT_LEFT, rt.Width() * 0.30);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl.InsertColumn(1,&#34;电话号码&#34;, LVCFMT_LEFT, rt.Width() * 0.30);<BR>&nbsp;&nbsp;&nbsp;&nbsp;m_ListCtrl.InsertColumn(2, &#34;客房状态&#34;, LVCFMT_LEFT, rt.Width() * 0.40);<BR><BR><BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;
<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 + -