Results 1 to 2 of 2

Thread: Listview

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Location
    México, D.F.
    Posts
    84

    Post

    Hi vb-world.

    A simple question:
    How can i select or highlight all the row in a listview?

    thanks in advance.


    ------------------
    Angel Maldonado López.
    Programmer
    [email protected]

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    Try this:
    Code:
    Private Sub Form_Load()
     SetListViewStyle ListView1
    End Sub
    
    
    Private Sub SetListViewStyle(TheList As ListView)
    ' change the style of the list view so that the whole row may be clicked and it is highlighted
    Dim lStyle As Long
    Const LVS_EX_FULLROWSELECT = &H20
    Const LVM_FIRST = &H1000
    Const LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + &H37
    Const LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + &H36
    
        lStyle = SendMessage(TheList.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
        lStyle = lStyle Or LVS_EX_FULLROWSELECT
        Call SendMessage(TheList.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, ByVal lStyle)
    
    End Sub
    ------------------
    Mark Sreeves
    Analyst Programmer

    [email protected]
    A BMW Group Company



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