Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB add item to listview

Posted on 2009-03-30
1
Medium Priority
?
456 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 48

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Loops Section Overview
Suggested Courses

886 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