Solved

VB add item to listview

Posted on 2009-03-30
1
450 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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
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.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

778 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