Results 1 to 2 of 2

Thread: ListViews, 2 questions, please read...

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    2
    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~
    ~Scran~

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    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:

    Code:
    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.

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width