CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 1999
    Posts
    16

    How to select the entire row in a List View/ List ctrl.?

    Hi,

    I am sending this as I cannot find my earlier post on the same issue.
    It is how to select the complete row and not the first column, in a List View/ List ctrl.

    I know that it is done by List View macro which does nothing but do a SendMessage to the List ctrl.

    But the question is what message ? LVN...

    regards

    Jeevan S


  2. #2
    Join Date
    Apr 1999
    Posts
    23

    Re: How to select the entire row in a List View/ List ctrl.?

    In VC++6 you can use LVS_EX_FULLROWSELECT in the ExtendedStyle of the ListCtrl.

    If you are using version 5 then you can find the information under listctrl in the codeguru sections, under listview.

    CListCtrl &ListCtrl = GetListCtrl();
    DWORD dwExStyles = ListCtrl.GetExtendedStyle();
    ListCtrl.SetExtendedStyle(dwExStyles | LVS_EX_FULLROWSELECT |
    LVS_EX_GRIDLINES |
    LVS_EX_HEADERDRAGDROP |
    LVS_EX_ONECLICKACTIVATE |
    LVS_EX_CHECKBOXES |
    LVS_EX_FLATSB|
    LVS_EX_TRACKSELECT);



  3. #3
    Join Date
    May 1999
    Location
    Houston - TX - US
    Posts
    29

    Re: How to select the entire row in a List View/ List ctrl.?



    in OnInitDialog have this.

    // lects the Full Row in the List Control

    DWORD dwStyle = m_MyListCtrl.SendMessage (LVM_GETEXTENDEDLISTVIEWSTYLE,0,0);
    dwStyle |= LVS_EX_FULLROWSELECT;
    m_MyListCtrl.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle);


    Hope this helps U.
    Good Luck.
    Yash.



  4. #4
    Join Date
    May 1999
    Posts
    16

    Re: How to select the entire row in a List View/ List ctrl.?

    Thanks,

    However I cannot locate the header file, which contains the values for the constant's
    LVS_EX_FULLROWSELECT, LVS_EX_GRIDLINES. LVS_EX_HEADERDRAGDROP etc...

    Maybe I will have to re-install VC, which may take time, as I can only do so in my free time.

    Pls can you email me the values or the header file.

    thanks in advance and regards

    Jeevan S ([email protected])




  5. #5
    Join Date
    Apr 1999
    Posts
    23

    Re: How to select the entire row in a List View/ List ctrl.?

    The following defines have been taken from COMCTRL.H, which can be found in the following directory
    Microsoft Visual Studio\VC98\INCLUDE

    #define LVS_EX_GRIDLINES 0x00000001
    #define LVS_EX_SUBITEMIMAGES 0x00000002
    #define LVS_EX_CHECKBOXES 0x00000004
    #define LVS_EX_TRACKSELECT 0x00000008
    #define LVS_EX_HEADERDRAGDROP 0x00000010
    #define LVS_EX_FULLROWSELECT 0x00000020 // applies to report mode only
    #define LVS_EX_ONECLICKACTIVATE 0x00000040
    #define LVS_EX_TWOCLICKACTIVATE 0x00000080



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