Solved

VB add item to listview

Posted on 2009-03-30
1
448 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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now