标签:style ar sp on div bs ad as nbsp
1. 隐藏表头方法
方法I: 设置ClistCtrl属性“ no column header”为"true";
方法II: 加载属性LVS_NOCOLUMNHEADER
2. 禁止表头拖动
自定义CMyListCtrl, 继承CListCtrl, 然后重载方法OnNotify()
//重载OnNotify来禁止拖动表头 //拖动ListCtrl列表宽度时接收到HDN_ITEMCHANGINGW和HDN_ITEMCHANGINGA两个消息, //但是由于这两个消息是包含在OnNotify消息中,故只能在响应NOTIFY消息后,在里面处理. BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
定义:
//禁止拖动表头 BOOL CMyListCtrl::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { // TODO: Add your specialized code here and/or call the base class HD_NOTIFY *pHDN = (HD_NOTIFY*)lParam; if (pHDN->hdr.code == HDN_ITEMCHANGINGW || pHDN->hdr.code == HDN_ITEMCHANGINGA) { *pResult = TRUE; // disable change return TRUE; // Processed message } return CListCtrl::OnNotify(wParam, lParam, pResult); }
标签:style ar sp on div bs ad as nbsp
原文地址:http://blog.csdn.net/jiangqin115/article/details/41458927