Solved

VB add item to listview

Posted on 2009-03-30
1
451 Views
Last Modified: 2012-05-06
hello there,
im trying to add items to listview but its saying ListItem is not a defined.. whats causing this?
Function Add(ByRef strClmOne As String, ByRef strClmTwo As String, ByRef lstW As ListView) As Object
		Dim LvItm As ListItem
		LvItm = lstW.ListItems.Add( , strClmOne & strClmTwo, strClmOne)
		LvItm.SubItems(1) = strClmTwo
	End Function

Open in new window

0
Comment
Question by:XK8ER
1 Comment
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 500 total points
ID: 24017744
I take it you are converting a VB6 project to VB.Net? Have you tried loading the original project in Visual Studio and running the built in converter?

Anyhoo, adding a ListViewItem is done like this....
    Public Sub Add(ByRef strClmOne As String, ByRef strClmTwo As String, ByRef lstW As ListView)
        Dim LvItm As ListViewItem
        LvItm = lstW.Items.Add(strClmOne & strClmTwo)
        LvItm.SubItems.Add(strClmTwo)
    End Sub

Open in new window

0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VS 2017 18 45
Input parameteres to DragOver 2 20
Access/Visual Basic Question 3 25
VB.NET - Refactor Class per SOLID principles 2 21
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question