Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ForeColor for some, but not all, listbox items?
Message
From
19/02/1999 16:42:34
John Streeter
Wanger Asset Management, L.P.
Chicago, Illinois, United States
 
 
To
19/02/1999 16:27:12
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00189495
Message ID:
00189521
Views:
9
Thanks for the response, James. I have the feeling that I am missing something simple ... I'm running the following code from the command line:

oForm = createobject("form")
oForm.show()
oForm.AddObject("lstTest","listbox")
oForm.lstTest.visible = .T.
oForm.lstTest.AddItem( "Hello (RED)" )
oForm.lstTest.AddItem( "Hello (GREEN)" )
oForm.lstTest.AddItem( "Hello (BLUE)" )

The following command should change the second row to green:

oForm.lstTest.ItemForeColor(2) = RGB(0,255,0)

but it changes all rows. I have also tried using the following command to make sure that the default setting for RowSourceType is, in fact, present:

oForm.lstTest.RowSourceType = 0

This does not seem to have any effect. Any thoughts on what I'm am overlooking? This has to be simple, right?


>
>John,
>
>Setting individual list item forecolors works only if your rowsourcetype is 0 and your items are added with AddItem(). (It may also work with rowsourcetype 1 -- but I have not tried i -- but it should)
>
>If your rowsourcetype is an array, cursor etc, then setting any item's forecolor sets the forecolor of all of the items.
>
>Regards,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform