Results 1 to 6 of 6

Thread: 1 Listbox element changed to a specific color?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    2

    Question

    Hi,

    How do you use API or anything (not even API, any sort of method, i dont care) to change 1 element of a listbox (list1.list(0)=?) to a specific coloe while leaving all the rest of the elements of the listbox black or as they previously were. Thanks, I appreciate it!

    ~Scran~

  2. #2
    Junior Member
    Join Date
    Jan 1999
    Posts
    30
    I think the best way is to create your own listbox.

  3. #3
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    use a listView with one column and report style


    Code:
    Option Explicit
    Private Sub Form_Load()
    
    Dim i As Integer
    
    Dim itmx As ListItem
    
    
    For i = 1 To 10
    
    Set itmx = ListView1.ListItems.Add(, , "item " & i)
    
    Next
    
    
    End Sub
    
    Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
    Item.ForeColor = &HFF&'red
    
    End Sub
    Mark
    -------------------

  4. #4
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455

    How to get a ListView

    Dear Mark Sreeves,

    Please can you tell me how to get the ListView object?

    In wich control file (.OCX) can I find it

    Nice regards,

    Michelle

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

    You are so polite!

    The listview control is in Microsoft Windows Common Controls
    Mark
    -------------------

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I think she must be the first person ever on this forum to be polite!
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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