Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Listview Problem

Listview Problem

Scheduled Pinned Locked Moved Visual Basic
helptutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    David Galloway
    wrote on last edited by
    #1

    I am using a Listview control in VB 6 SP5. I highlight the last entry accessed by the user by setting listview.selecteditem = listview.listitems(5), for example. If I shift-click on an item in the list, say item 6 when item 5 is lit, everything from item 6 to item 1 is highlighted instead of just items 5 and 6. The following code reproduces the problem. It is the form load for a new form with a listview control added to the form. Private Sub Form_Load() Dim i As Integer Dim lv As ListItem ListView1.MultiSelect = True For i = 1 To 10 Set lv = ListView1.ListItems.Add(, , "Item " & i) lv.Selected = False Next i Set lv = ListView1.ListItems(5) Set ListView1.SelectedItem = lv End Sub If I now shift-click item 6, 1 through 6 are lit. Any ideas? Maybe a listview bug? Thanks for your help. Dave

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups