Click to See Complete Forum and Search --> : 1 Listbox element changed to a specific color?
scraniel
May 6th, 2000, 11:20 AM
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!
DrBrain
May 7th, 2000, 02:06 AM
I think the best way is to create your own listbox.
Mark Sreeves
May 7th, 2000, 05:22 PM
use a listView with one column and report style
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
michelle
Jul 3rd, 2000, 02:17 AM
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
Mark Sreeves
Jul 4th, 2000, 09:03 AM
Dear michelle
You are so polite! :)
The listview control is in Microsoft Windows Common Controls
parksie
Jul 4th, 2000, 12:50 PM
I think she must be the first person ever on this forum to be polite!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.