单文档分割成双视图,怎么我动态创建的CListCtrl控件都看不到的?
时间:2011-12-06
来源:互联网
void CTestView::Show1()
{
CButton *p_MyBut[1];
p_MyBut[0]=NewMyButton(IDC_MYBUTTON1,CRect(20,10,90,40),0);
CListCtrl p_list;
p_list.Create(LVS_REPORT | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES, CRect(50,80,220,140), this, IDC_LIST1);
DWORD dwSystl = ::GetWindowLong(p_list.m_hWnd,GWL_STYLE);
SetWindowLong(p_list.m_hWnd,GWL_STYLE,dwSystl|LVS_REPORT);
DWORD Exsystl =p_list.GetExtendedStyle();
p_list.SetExtendedStyle(Exsystl|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_CHECKBOXES);
p_list.InsertColumn(0,"xx",LVCFMT_CENTER,110,0);
p_list.InsertColumn(1,"xx",LVCFMT_CENTER,120,0);
p_list.InsertColumn(2,"xx",LVCFMT_CENTER,120,0);
p_list.InsertColumn(3,"xx",LVCFMT_CENTER,120,0);
p_list.ShowWindow(SW_SHOW);
}
CTestView是基于CView类的,按钮可以显示、列表控件就没有显示、但是如果在最后加个MessageBox("");那么弹出MessageBox窗口的时候就能看到列表控件、一关掉MessageBox窗口列表就消失。。。怎么回事?
{
CButton *p_MyBut[1];
p_MyBut[0]=NewMyButton(IDC_MYBUTTON1,CRect(20,10,90,40),0);
CListCtrl p_list;
p_list.Create(LVS_REPORT | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES, CRect(50,80,220,140), this, IDC_LIST1);
DWORD dwSystl = ::GetWindowLong(p_list.m_hWnd,GWL_STYLE);
SetWindowLong(p_list.m_hWnd,GWL_STYLE,dwSystl|LVS_REPORT);
DWORD Exsystl =p_list.GetExtendedStyle();
p_list.SetExtendedStyle(Exsystl|LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_CHECKBOXES);
p_list.InsertColumn(0,"xx",LVCFMT_CENTER,110,0);
p_list.InsertColumn(1,"xx",LVCFMT_CENTER,120,0);
p_list.InsertColumn(2,"xx",LVCFMT_CENTER,120,0);
p_list.InsertColumn(3,"xx",LVCFMT_CENTER,120,0);
p_list.ShowWindow(SW_SHOW);
}
CTestView是基于CView类的,按钮可以显示、列表控件就没有显示、但是如果在最后加个MessageBox("");那么弹出MessageBox窗口的时候就能看到列表控件、一关掉MessageBox窗口列表就消失。。。怎么回事?
作者: zereyyoooo 发布时间: 2011-12-06
顶上去~!
作者: zereyyoooo 发布时间: 2011-12-06
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28