首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

在list control 中平添了checkbox风格为什么不可用选择

2012-11-04 
在list control 中添加了checkbox风格为什么不可用选择LC_search_result.SetExtendedStyle(LC_search_resu

在list control 中添加了checkbox风格为什么不可用选择

LC_search_result.SetExtendedStyle(LC_search_result.GetExtendedStyle()|LVS_EX_DOUBLEBUFFER|LVS_EX_FULLROWSELECT| LVS_EX_CHECKBOXES); 

这样设置了以后 只能选择一行 而 check box 的按钮不响应

[解决办法]
这个帖子应该发在vc/mfc板块。
设置listctrl 风格及扩展风格 

C/C++ code
LONG lStyle;lStyle = GetWindowLong(m_list.m_hWnd, GWL_STYLE);//获取当前窗口stylelStyle &= ~LVS_TYPEMASK; //清除显示方式位lStyle |= LVS_REPORT; //设置styleSetWindowLong(m_list.m_hWnd, GWL_STYLE, lStyle);//设置style  DWORD dwStyle = m_list.GetExtendedStyle();dwStyle |= LVS_EX_FULLROWSELECT;//选中某行使整行高亮(只适用与report风格的listctrl)dwStyle |= LVS_EX_GRIDLINES;//网格线(只适用与report风格的listctrl)dwStyle |= LVS_EX_CHECKBOXES;//item前生成checkbox控件m_list.SetExtendedStyle(dwStyle); //设置扩展风格 

热点排行