Coloring separate items within listboxes and comboboxes<br><br>It's a dead-simple trick: you use a RowSourceType of 9 (popup). You can define a popup with each bar showing in different colors (and you can re-define bars as necessary). Below is a little simple, runnable code so you can see the effect. <br>* The first section of code merely enables you to <br>* run this code multiple times,<br>* so you can see the effect in both baseclasses:<br>if type("_screen.y.baseclass"

= "C"<br> if upper(_screen.y.baseclass) = "LISTBOX"<br> myclass = "combobox"<br> else<br> myclass = "listbox"<br> endif<br> _screen.removeobject("y"

<br>else<br> myclass = "listbox"<br>endif <br><br>* This middle section of code defines the popup<br>* we'll use as rowsource, so you<br>* can see the color-handling syntax.<br>* Please note the *comma* in the color clauses below<br>* -- we need to change the contents of <br>* the *second color pair* for each bar as needed:<br>define popup x<br>define bar 1 of x prompt "red on white" ;<br> color ,rgb(255,0,0,255,255,255)<br>define bar 2 of x prompt "not touched"<br>define bar 3 of x prompt "red also" ;<br> color ,rgb(255,0,0,255,255,255)<br>define bar 4 of x prompt "not touched"<br>define bar 5 of x prompt "purple on green" ;<br> color ,rgb(255,0,255,125,255,0)<br>define bar 6 of x prompt "blue on yellow" ;<br> color , rgb(0,0,255,255,255,0)<br><br>* And now to see the popup as a rowsource:<br>_screen.addobject("y",myclass)<br>with _screen.y<br> .rowsourcetype = 9<br> .rowsource = "x"<br> .visible = .t.<br>endwith <br>You'll note that the documentation specifies RowSourceType of 9 as "for backward compatibility only". Well, this seems like a waste of perfectly useful feature to me. If anybody else can create the same effect without a RowSourceType of 9, I'll be willing to believe the docs. <br><br>* repliers note: OMG, I wish I was that smart. That was from Lisa Slater Nichols website. <br><br>JohnDurbin<br>