请教::ListView表表头怎样可以固定,不能拉动?

chenjiawei0130 2005-11-16 07:11:27
我应用了ListView表,表头如下:
IP | NAME | STATUS
表头3项,没两项之间有一竖线,点它可以拉动每一项的长度,
比如拉动IP与NAME之间的长度,可左右移动,就增大或缩小了IP栏的长度,
但是我现在想固定它,不让别人拉动,有这样的扩展属性添加么,或者自己怎么增加代码?
请各位高手帮给点方法,谢了!!
...全文
664 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
ywfscu 2005-11-18
  • 打赏
  • 举报
回复
LVS_EX_HEADERDRAGDROP
Version 4.70. Enables drag-and-drop reordering of columns in a list-view control. This style is only available to list-view controls that use the LVS_REPORT style.

dwExStyle = GetExtendedStyle() ;

SetExtendedStyle(dwExStyle & ~LVS_EX_HEADERDRAGDROP ) ;// 注意先非,再与
chenjiawei0130 2005-11-18
  • 打赏
  • 举报
回复
非常感谢以上各位的解答,很感谢,我已经根据各位的意见搞定了,
chenjiawei0130 2005-11-17
  • 打赏
  • 举报
回复
BOOL CMyListCtrl::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
switch (((NMHDR*)lParam)->code)
{
case HDN_BEGINTRACKW:
case HDN_BEGINTRACKA:
*pResult = TRUE; // disable tracking
return TRUE; // Processed message
}

return CListCtrl::OnNotify(wParam, lParam, pResult);
}
哪位给解释一下,看不懂啊
lixiaosan 2005-11-17
  • 打赏
  • 举报
回复
http://www.codeguru.com/Cpp/controls/listview/columns/article.php/c1065/
http://www.codeguru.com/Cpp/controls/listview/columns/article.php/c1061/
luolovegui 2005-11-17
  • 打赏
  • 举报
回复

如何锁定 ListView 的栏目头宽度

http://www.vckbase.com/document/viewdoc/?id=675
abesky 2005-11-17
  • 打赏
  • 举报
回复
HDN_BEGINTRACKW
HDN_BEGINTRACKA
是移动表头的状态
Notifies a header control's parent window that the user has begun dragging a divider in the control (that is, the user has pressed the left mouse button while the mouse cursor is on a divider in the header control). This notification message is sent in the form of a WM_NOTIFY message.

*pResult = TRUE; // disable tracking
return TRUE;
让系统不处理所以就固定了表头
chenjiawei0130 2005-11-16
  • 打赏
  • 举报
回复
高手帮忙啊

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧