DWORD styles = LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_CHECKBOXES;
ListView_SetExtendedListViewStyleEx(m_wendang.m_hWnd, styles,styles );
    m_wendang.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_HEADERDRAGDROP);都不行诶。急

解决方案 »

  1.   

    DWORD dwStyle=::GetWindowLong(m_list.m_hWnd,GWL_STYLE);
    //设置为报表形式
    SetWindowLong(m_list.m_hWnd,GWL_STYLE,dwStyle | LVS_REPORT);
    DWORD ExStyle=m_list.GetExtendedStyle();
    //设置为整栏选择和网格线
    m_list.SetExtendedStyle(ExStyle | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
      

  2.   

    http://blog.csdn.net/handsomerun/archive/2006/04/13/662462.aspx
      

  3.   

    一般来说不太可能,这么弄是可以的
    记得把listctrl
    设成report的
      

  4.   

    BOOL CCeshiDlg::OnInitDialog()
    {
        
    CDialog::OnInitDialog();
    DWORD styles = LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_CHECKBOXES;
    ListView_SetExtendedListViewStyleEx(m_wendang.m_hWnd, styles,styles );
        m_wendang.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_HEADERDRAGDROP);
        m_wendang.SetBkColor(RGB(177,151,240));
    m_wendang.SetTextBkColor(RGB(177,151,240));

    m_wendang.SetTextColor(RGB(0, 0, 255));
    m_wendang.InsertColumn(0,"文档编号",LVCFMT_LEFT,100);
    m_wendang.InsertColumn(1,"文档名");
    m_wendang.InsertColumn(2,"文档路径");
    m_wendang.InsertColumn(3,"文档描述");
    // Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range.
    ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
    ASSERT(IDM_ABOUTBOX < 0xF000);

    CMenu* pSysMenu = GetSystemMenu(FALSE);
    if (pSysMenu != NULL)
    {
    CString strAboutMenu;
    strAboutMenu.LoadString(IDS_ABOUTBOX);
    if (!strAboutMenu.IsEmpty())
    {
    pSysMenu->AppendMenu(MF_SEPARATOR);
    pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
    }
    } // Set the icon for this dialog.  The framework does this automatically
    //  when the application's main window is not a dialog
    SetIcon(m_hIcon, TRUE); // Set big icon
    SetIcon(m_hIcon, FALSE); // Set small icon

    // TODO: Add extra initialization here

    return TRUE;  // return TRUE  unless you set the focus to a control
    }
    大家看一下,这样子的语句怎么就是出不来网格线
      

  5.   

    long style = GetWindowLong(m_ClistView.m_hWnd,GWL_STYLE);
    style &= ~LVS_TYPEMASK; style |= LVS_REPORT;
    SetWindowLong(m_ClistView.m_hWnd,GWL_STYLE,style );//
    把这几句随便加到上面那个函数的什么地方如果还不行的话,估计楼主用的可能不是CListCtrl控件,而是CListBox控件