ListView in Detailed View State

Madz

Centurion
Joined
Jan 22, 2003
Messages
155
I am developing an internet Application which is like DAP or Intenret Download Manager, I am using a ListView control to display the files, i have 3 columns

1- File Name
2- Status
3- Time Remaining

With this code i am able to add item in first column

Code:
ListView1.Items.Add(myinewitem)

But i am not sure how to write value in the second , or third colums

Please help me
 
I prefer this:
Visual Basic:
Dim lvItem as ListViewItem
lvItem=ListView1.Items.Add(myinewitem)
lvItem.SubItems.Add(mysubitem1)
lvItem.SubItems.Add(mysubitem2)
.
.
.
 
You don't necessarily have to pass a listviewsubitem (as in the above example).

Visual Basic:
lvItem.SubItems.Add(New ListViewSubItem("String"))
 
That's correct Heiko. I was presuming that mysubitem is a string variable.
Anyway to be precise you even can drop the new keyword.
Visual Basic:
lvItem.SubItems.Add("String")
is sufficient.
 
Hello Dear

Thanks for your Help, now my problem has been solved with this colde
Visual Basic:
ListView1.Items.Add(TextBox1.Text)
        ListView1.Items.Item(ListView1.Items.Count - 1).SubItems.Add(TextBox2.Text)
        ListView1.Items.Item(ListView1.Items.Count - 1).SubItems.Add(TextBox3.Text)

i want to do some thing more, i want to change colors and fonts with in some column but its not changing

please provide me some help
 
Search for color and ListViewSubItem (I think) - this has been discussed a couple of times before. I can't recall offhand if you can or cannot change the color of subitems - the search should help.

-Ners
 
Back
Top