CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1

    CListCtrl - Full row selection

    How to select a full row in a CListCtrl?
    Thanks in advance.


  2. #2
    Join Date
    May 1999
    Posts
    128

    Re: CListCtrl - Full row selection


    DWORD dwStyleEx = pListCtrl->GetExtendedStyle();
    dwStyleEx |= LVS_EX_FULLROWSELECT;
    pListCtrl->SetExtendedStyle(dwStyleEx);






  3. #3
    Join Date
    Jun 1999
    Location
    Edmonton, Alberta, Canada
    Posts
    12

    Re: CListCtrl - Full row selection

    That works fine if you're using VC6, but GetExtendedStyle and SetExtendedStyle weren't supported in previous incarnations of VC. This will do the same thing (plus add header drag-drop and gridlines) for a list control. If you're using a list view, run this in your OnCreate override and drop the "m_list." prefix to SendMessage (tested with VC5).

    // Assuming CListCtrl m_list;
    int nStyleEx = LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES;
    m_list.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, nStyleEx, nStyleEx);





  4. #4
    Join Date
    May 1999
    Posts
    96

    Re: CListCtrl - Full row selection

    is there an equivalent to these functions in vc++ 5.0


  5. #5
    Join Date
    May 1999
    Location
    Israel
    Posts
    16

    Re: CListCtrl - Full row selection

    Hi,

    Add this line it will work.
    //m_List is your CListCtrl
    m_List.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);

    Regards,
    Joel.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured