CListCtrl使用技巧
来源:互联网 发布:网络有利有弊 英语翻译 编辑:程序博客网 时间:2024/06/07 07:25
隐藏一列
// 控制控件的列宽
BOOL CMyListCtrl::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
HD_NOTIFY *pHDN = (HD_NOTIFY*)lParam;
if((pHDN->hdr.code == HDN_ITEMCHANGINGW || pHDN->hdr.code == HDN_ITEMCHANGINGA)
&& pHDN->pitem->cxy < 80)
{
*pResult = TRUE; // disable change
return TRUE; // Processed message
}
return CListCtrl::OnNotify(wParam, lParam, pResult);
}
//禁止所有的列移动
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);
}
//禁止特定的列移动
BOOL CMyListCtrl::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
HD_NOTIFY *pHDN = (HD_NOTIFY*)lParam;
if((pHDN->hdr.code == HDN_BEGINTRACKW || pHDN->hdr.code == HDN_BEGINTRACKA)
&& pHDN->iItem == 0) // Prevent only first (col# 0) from resizing
{
*pResult = TRUE; // disable tracking
return TRUE; // Processed message
}
return CListCtrl::OnNotify(wParam, lParam, pResult);
}
Top
//*****************************************************
if (pHDN->iItem == 0)作用是禁掉第一列的拖动,根据你自己的需要改写0为合适的数字吧
//******************************************
其它 CListCtrl使用技巧
http://blog.csdn.net/lixiaosan/archive/2006/04/07/653563.aspx
- CListCtrl 使用技巧 CListCtrl 用法
- CListCtrl 使用技巧 CListCtrl 用法 .
- CListCtrl使用技巧
- CListCtrl使用技巧
- CListCtrl使用技巧
- CListCtrl 使用技巧
- CListCtrl使用技巧
- CListCtrl 使用技巧
- CListCtrl使用技巧
- CListCtrl使用技巧
- CListCtrl使用技巧
- CListCtrl使用技巧
- CListCtrl使用技巧
- CListCtrl使用技巧
- CListCtrl 使用技巧
- CListCtrl 使用技巧
- 【转】CListCtrl 使用技巧
- CListCtrl使用技巧
- linux下安装mplayer
- 为JAVA而担忧
- 穿衣指引
- class-lazy
- 如何给孩子喂丸药
- CListCtrl使用技巧
- C# FTP 各种操作
- 军工科研单位如何保证机密信息不被窃取
- struts2.0拦截器
- 安装程序 Repack 攻略 之 MSI 篇(MS版)
- 如何预防和治疗儿童铅中毒
- 远镜数据图像下载问题
- C盘Windows文件夹里重要文件的作用
- respose状态个案研究