PDA

Click to See Complete Forum and Search --> : ListViews, 2 questions, please read...


scraniel
May 15th, 2000, 02:33 AM
1. After I inputted a word from a file and put it into a ListView, how in the world do I change the color in the index of the ListView that I just inputted without changing any colors of other data or elements in the Listview???


set item=listview1.listitems.add(word)
<code> ?????


2. after i input all the data I want into the ListView, it puts them all in many columns and rows like a table, screwing up the whole purpose of what I'm trying to accomplish. How do i just have it listed in one nice row with NO horizontal scroll bar, only a vertical scroll bar?

Thanks a lot, I appreciate it to anybody who helps. Thanks again!

~Scran~

Mark Sreeves
May 15th, 2000, 07:09 PM
1.
item.ForeColor = &H8080FF'sets the new item to red

if you want it to be set back to another colour when the next item is entered:


if ListView2.ListItems.Count > 0 then'error on first pass without this
Set itmx = ListView2.ListItems(ListView2.ListItems.Count)
itmx.ForeColor = &H80000008
end if

'now add the new one




2. adjust the width of the columns so they fit

this is in form load of the project I'm working on at the moment:

the listview has 2 columns and this adjusts the right hand one

the -300 is to allow for the verticle scroll bar when it appears.


With ListView2
.ColumnHeaders(2).Width = (.Width - .ColumnHeaders(1).Width) - 300
End With