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! Please help! Urgent!

ListView! Please help! Urgent!

Scheduled Pinned Locked Moved Visual Basic
csharphelptutorialquestion
4 Posts 4 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.
  • C Offline
    C Offline
    charleslau2855
    wrote on last edited by
    #1

    hi, Everyone know how to convert this vb6 code " ListView1.listitem(i + 1).subitem(j + 1).add" to vb.net?? Please help! charleslau2855

    C S S 3 Replies Last reply
    0
    • C charleslau2855

      hi, Everyone know how to convert this vb6 code " ListView1.listitem(i + 1).subitem(j + 1).add" to vb.net?? Please help! charleslau2855

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      ListView1.Items(i+1) is how you access the item. I assume it has a SubItems property.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

      1 Reply Last reply
      0
      • C charleslau2855

        hi, Everyone know how to convert this vb6 code " ListView1.listitem(i + 1).subitem(j + 1).add" to vb.net?? Please help! charleslau2855

        S Offline
        S Offline
        sa Eish
        wrote on last edited by
        #3

        If you want to add an item to a listview... If i understand your question right:-D

        'Single Entry at the end of the list

        Dim _ListViewItem AS ListviewItem = New ListViewItem(New String() {Column1Data, Column2Data, ...ColumnXData}, -1) _ListView.Items.Add(ListViewItem)

        'Multible Entry
        Dim _ListViewItems(X) as ListViewItem Dim _ListViewItem AS ListviewItem

        ' The loading loop
        _ListViewItem = New ListViewItem(New String() {Column1Data, Column2Data, ...ColumnXData}, -1) _ListViewItems(_ListViewItems.Lengt-1) = ListViewItem
        'Loop ends

        _ListView.Items.AddRange(ListViewItems)

        This is A easy why to add items to a listview...:) VB6 = :doh:

        1 Reply Last reply
        0
        • C charleslau2855

          hi, Everyone know how to convert this vb6 code " ListView1.listitem(i + 1).subitem(j + 1).add" to vb.net?? Please help! charleslau2855

          S Offline
          S Offline
          Stephen McGuire
          wrote on last edited by
          #4

          I don't think you can add SubItems by index. However, you can retrieve SubItems by index. You will probably need to use an array to insert the value at the appropriate index and then rebuild the ListView using your array. Steve

          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