Results 1 to 3 of 3

Thread: Listview Scrolling & Highlight

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    usa
    Posts
    100

    Listview Scrolling & Highlight

    How can I keep the first row in my listview highlighted even when I am typing in a textbox? that is, when the textbox has the focus, the first row turns gray.

    And how do I stop the listview from scrolling when I type in the textbox to search the listview? I would like when the text is found, it always at the top.

  2. #2
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011
    Post some code of yours... so that it can be altered to meet your requirement....

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    usa
    Posts
    100

    Listview Scrolling & Highlight

    This loads the listview. FullRowSelect is on.
    First row is grayed out when listview loses focus.

    Private Sub LoadListView()
    Dim Items as Listitems
    Do Until rst.EOF
    'Add List Items
    Set Items = lsv.ListItems.Add(, , rst!fieldname)
    Items.SubItems(1) = rst!fieldname
    Items.SubItems(2) = rst!fieldname
    Items.SubItems(3) = rst!fieldname
    Items.SubItems(4) = rst!fieldname
    rst.MoveNext
    Loop
    lsv.SelectedItem.EnsureVisible
    End Sub


    This searches listview.
    But I would like when text is found, the selected row is always at the top

    Set itmFound = lsv.FindItem(txtGetText, , , lvwPartial)
    If Not itmFound Is Nothing Then
    itmFound.Selected = True
    itmFound.EnsureVisible
    itmFound = lsvZip.SelectedItem
    End If

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