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. Set Selected Item

Set Selected Item

Scheduled Pinned Locked Moved Visual Basic
question
3 Posts 3 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.
  • M Offline
    M Offline
    mosquitooth
    wrote on last edited by
    #1

    Hi how can I set the item that is selected in a listview? Thanks mosquitooth

    N D 2 Replies Last reply
    0
    • M mosquitooth

      Hi how can I set the item that is selected in a listview? Thanks mosquitooth

      N Offline
      N Offline
      Nadroj
      wrote on last edited by
      #2

      u talking about vb windows apps? i havnet used them in long time, and not at all for vb.net. i thought there was a, ie., "list1.selected" boolean property? well, i know thats how i did it in vb6. ------------------------ Jordan. III

      1 Reply Last reply
      0
      • M mosquitooth

        Hi how can I set the item that is selected in a listview? Thanks mosquitooth

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        Simple:

        ListView1.Item(<index>).Selected = True
        

        But, the ListView control also has to have the focus for the select highlight to show. Use this:

        ListView1.Select()                         ' Make the ListView the active control.
        ListView1.Item(<index>).Selected = True    ' Select the items we want.
        

        RageInTheMachine9532

        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