Solved

VB add item to listview

Posted on 2009-03-30
1
453 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

710 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