Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

 

ListView1.Items.Add(myinewitem)

 

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

 

Please help me

The one and only

Dr. Madz

eee-m@il

Posted

I prefer this:

Dim lvItem as ListViewItem
lvItem=ListView1.Items.Add(myinewitem)
lvItem.SubItems.Add(mysubitem1)
lvItem.SubItems.Add(mysubitem2)
.
.
.

Posted

You don't necessarily have to pass a listviewsubitem (as in the above example).

 

lvItem.SubItems.Add(New ListViewSubItem("String"))

.nerd
Posted

That's correct Heiko. I was presuming that mysubitem is a string variable.

Anyway to be precise you even can drop the new keyword.

lvItem.SubItems.Add("String")

is sufficient.

Posted

Hello Dear

 

Thanks for your Help, now my problem has been solved with this colde

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

The one and only

Dr. Madz

eee-m@il

  • *Experts*
Posted

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

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...