MFC|ListCtrl中InsertColumn后标题不显示

来源:互联网 发布:大排畸数据看男女准吗 编辑:程序博客网 时间:2024/06/08 02:53

问题的原因是在调用InsertColumn函数之前,需要将控件ClistCtrl的Style设为REPORT。

有两种解决办法:
1.在ClistCtrl的属性VIEW中改
这里写图片描述

2.调用InsertColumn函数之前,插入如下代码:
LONG styles;
styles = GetWindowLong(pList->m_hWnd, GWL_STYLE);
SetWindowLong(pList->m_hWnd, GWL_STYLE, styles |LVS_REPORT);

原创粉丝点击