Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21846

Listview Change SubItems Forecolor

$
0
0
I have read several forum articles regarding the Listview Subitems Forecolor and I am unable to get it to work. Here is my code while adding items to the Listview Box. What I would like to do, Is change the forecolor of an item based on the variable 'Ty'. I am sure there is a simple resolution - but for the life of me I can't get it to work. Here is the code (Written in VB6)

Dim a As Integer
a = 0
LstData.ListItems.Clear
Close #5
Open "C:\DATA\WIP.DAT" For Input As #5
While Not EOF(5)

Line Input #5, strData
a = a + 1
Ty = Mid(strData, 1, 1)
dp = Mid(strData, 3, 7)
expire = Mid(strData, 13, 8)
MyDays = Mid(strData, 24, 3)
MyCode = Mid(strData, 28, 3)
zone = Mid(strData, 33, 2)
custno = Mid(strData, 38, 11)
customer = Mid(strData, 50, 10)
operator = Mid(strData, 62, 8)
dpinfo = Mid(strData, 75, 160)
Set objlist = LstData.ListItems.Add(, , a) ' Adds Items to List

objlist.SubItems(1) = Ty
objlist.SubItems(2) = dp
objlist.SubItems(3) = expire
objlist.SubItems(4) = MyDays
objlist.SubItems(5) = MyCode
objlist.SubItems(6) = zone
objlist.SubItems(7) = custno
objlist.SubItems(8) = customer
objlist.SubItems(9) = operator
objlist.SubItems(10) = dpinfo


Wend
Close #5

Viewing all articles
Browse latest Browse all 21846

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>