ListView! Please help! Urgent!
-
hi, Everyone know how to convert this vb6 code " ListView1.listitem(i + 1).subitem(j + 1).add" to vb.net?? Please help! charleslau2855
-
hi, Everyone know how to convert this vb6 code " ListView1.listitem(i + 1).subitem(j + 1).add" to vb.net?? Please help! charleslau2855
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
-
hi, Everyone know how to convert this vb6 code " ListView1.listitem(i + 1).subitem(j + 1).add" to vb.net?? Please help! charleslau2855
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:
-
hi, Everyone know how to convert this vb6 code " ListView1.listitem(i + 1).subitem(j + 1).add" to vb.net?? Please help! charleslau2855
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