Valhalla Legends Forums Archive | Visual Basic Programming | Column adding help....

AuthorMessageTime
OuTLawZGoSu
Sup.. i need to know how to add text to a colomn.i have list1 and on that list i have 2 columns. on the first one, i need ti to say "asdf" and on the second one i need it to say ";lkj". i dono how to do that.

i no this one:
private sub button1_click()
form1.list1.additem "asdf"
end sub

but i dont no how to add it to the second colomn.

Help?

L8terZ
August 18, 2003, 12:37 AM
warz
Lets say you have 2 rows, and several columns in your listview, and want to set some text in each of them. No worries, it's simple.

Sets the first cell on the first row to something.
[code]
.ListItems(1).Text = varAccount(0)
[/code]

Sets the second cell on the first row to something.
[code]
.ListItems(1).ListSubItems(1).Text = "Initializing..."
[/code]

Third cell...
[code]
.ListItems(1).ListSubItems(2).Text = "0-0-0"
[/code]

...and so on. How about the second row?
[code]
.ListItems(2).Text = varAccount(1)
[/code]

Simple enough, right? That was pulled from http://tks.slacktech.com/source/vb/SoupBotWinBot.zip .
August 18, 2003, 2:06 AM
OuTLawZGoSu
i was realy talking about a listbox but ill try that anyway thx

EDIT: Hm.... i cant get teh listview to work properly, can you tell me how to do this in a listbox?
August 18, 2003, 2:39 AM
iago
You can't.
August 18, 2003, 5:44 AM

Search