标签:
CRect rectDummy; rectDummy.SetRectEmpty(); LONG lStyle = GetWindowLong(m_wndListView.m_hWnd,GWL_STYLE); lStyle &= ~LVS_TYPEMASK; lStyle = LVS_REPORT | WS_CHILD|WS_VISIBLE ; if (!m_wndListView.Create(lStyle, rectDummy, this, 2)) { TRACE0("未能创建列表框\n"); return -1; // 未能创建 } DWORD dwStyle = m_wndListView.GetExtendedStyle(); dwStyle = LVS_EX_GRIDLINES |LVS_EX_FULLROWSELECT; m_wndListView.SetExtendedStyle(dwStyle); m_wndListView.InsertColumn(0,L"型号",LVCFMT_LEFT,120); m_wndListView.InsertColumn( 1, L"名称", LVCFMT_LEFT, 80 ); m_wndListView.InsertColumn( 2, L"工序号", LVCFMT_LEFT, 80 ); m_wndListView.InsertColumn( 3, L"工序", LVCFMT_LEFT, 80 ); m_wndListView.InsertColumn( 4, L"定额", LVCFMT_LEFT, 80 ); m_wndListView.InsertColumn( 5, L"班产", LVCFMT_LEFT, 80 ); m_wndListView.InsertColumn( 6, L"编码", LVCFMT_LEFT, 80 );
4、在父控件的WM_SIZE消息中调整该对象的大小
m_wndListView.SetWindowPos(NULL,0,0,cx,cy,SWP_NOACTIVATE | SWP_NOZORDER);
标签:
原文地址:http://www.cnblogs.com/wangrx/p/5130211.html