BOOL CPeopleManageView::PreCreateWindow(CREATESTRUCT& cs)
{

cs.style|=LVS_REPORT|LVS_SORTASCENDING;
GetListCtrl().SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES); return CListView::PreCreateWindow(cs);
}这是我的PreCreateWindow函数,为什么没有显示出来分隔线呢?

解决方案 »

  1.   

    Is your PreCreateWindow() function called?
    Add a messagebox to verify this!I am afraid it is not called.Add the code in PreSubclassWindow() using GetStyle() ModifyStyle.
      

  2.   

    用了MessageBox()了,这个函数是被运行的
      

  3.   

    Add the code in PreSubclassWindow() using GetStyle() ModifyStyle.这句话看不太懂
      

  4.   

    已经用了啊
    GetListCtrl().SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
    可是没反应啊
      

  5.   

    应该放在OnInitialUpdate(),我试过了,OK!
       我想,在CListView::PreCreateWindow(cs)执行前GetListCtrl()应该是无效的。void CPeopleManageView::OnInitialUpdate() 
    {
    CListView::OnInitialUpdate();
    GetListCtrl().SetExtendedStyle(LVS_EX_FULLROWSELECT|
                  LVS_EX_GRIDLINES|LVS_EX_TRACKSELECT |LVS_EX_ONECLICKACTIVATE|);
    }