Groups | Blog | Home
all groups > vb.net controls > april 2005 >

vb.net controls : .NET NEWBIE... Listview control question


Guy Cohen
4/29/2005 12:00:00 AM
Hi all,
I am new to vb.net (2003).
I created a listview with two columns.
I want to add an item and alter the text in both columns.
I tried some code but could not find the right way.

How do I change the first column text ?
How do I change the second column text?

TIA
Guy

-------------
'This does not work as I expect .
'I want the first column to be "row" and the second column to be "one"

Dim LVI As ListViewItem
LVI = New ListViewItem

With lvSMSList
LVI.Text = "Row"
LVI.SubItems(0).Text = "One"
Call .Items.Add(LVI)
End With

If Not (LVI Is Nothing) Then
LVI = Nothing
End If
--------------

Crouchie1998
4/29/2005 12:00:00 AM
I don't understand you. Explain it clearer & I'll help you

Are you wanting to change the column name (header) or the data in the two
columns?

Also, in VB.NET like VB 6 you don't need to use 'Call'

Crouchie1998
BA (HONS) MCP MCSE

Herfried K. Wagner [MVP]
4/29/2005 12:00:00 AM
"Crouchie1998" <crouchie1998@spamcop.net> schrieb:
[quoted text, click to view]

.... except in this situation:

\\\
Call (New Foo()).Bar()
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
AddThis Social Bookmark Button