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

Thread: ListView

  1. #1
    Join Date
    Aug 1999
    Posts
    11

    ListView

    Hello
    My Name is eileen, can anyone help me how to highlight an entire row in a listview



  2. #2
    Guest

    Re: ListView

    If you are using VB6 version of the control, there is a property setting that will allow you to highlight the entire row. I believe its called SelectEntireRow or HighlightEntireRow or something to that effect.
    If your using VB5, I have yet to find a way.
    [email protected]


  3. #3
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: ListView

    Hi

    If you are using VB5 then you can use the following code to turn on/off full row highlighing in a ListView.

    - Place the following into a BAS module (or into a form - just don't forget to change the 'Publics' as appropriate)


    public Declare Function SendMessageLong Lib "user32" Alias "SendMessageA" (byval hwnd as Long, byval Msg as Long, byval wParam as Long, byval lParam as Long) as Long
    '
    ' ListView API Constants
    '
    public Const LVM_FIRST as Long = &H1000
    public Const LVM_SETEXTENDEDLISTVIEWSTYLE as Long = LVM_FIRST + 54
    public Const LVS_EX_FULLROWSELECT = &H20
    '
    ' Show Full Row Select Routine - Call with :
    '
    ' ShowFullRow ListView1.Hwnd, true
    '
    public Sub ShowFullRow(byval lLVHwnd as Long, byval bShowFullRow as Boolean)
    '
    SendMessageLong lLVHwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_FULLROWSELECT, bShowFullRow
    '
    End Sub







    Chris Eastwood

    CodeGuru - the website for developers
    http://www.codeguru.com/vb

  4. #4
    Join Date
    May 1999
    Posts
    3,332

    Re: ListView

    set a check mark on the FullRowSelect property in the properties dialog of the listview in VB 6.
    Now, each time the user clicks on the row it will be selected. If you want to select it in code,set the selected property of the relevante Listitem to true.


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