Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox Row Colors
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00358180
Message ID:
00358291
Views:
14
There is a way, but it has limited usability:

One of the Rowsource types for a listbox control is Popup. You can define a popup with bars that have different fonts, colors, etc., and then set the listbox rowsource to the popup.

Create a form, drop a listbox on it, put the following code into the init of the form:
DEFINE POPUP ListTest
DEFINE BAR 1 OF ListTest Prompt "Rick" Font "Times New Roman" ,12
DEFINE BAR 2 OF ListTest Prompt "Chris" Font "Times New Roman" , 8 
DEFINE BAR 3 OF ListTest Prompt "Dan" Font "Arial" , 12 STYLE "B" COLOR ,W+/G

this.List1.RowsourceType = 9
this.List1.RowSource ="ListTest"
The contents of the listbox are based on the bars in the popup, which means that to change the contents of the listbox, you must redefine the bars of the popup. It also means that the listbox only has one column and that whatever you set controlsource to will only have the caption of the bar as the value. Like I said, it is limited.

Rick

>Using the standard listbox control, is there any way to change the font color of a specific item in a list box?
>
>Thanks in advance...
>
>Eric Stephani
Rick Hodder
MCP Visual Foxpro
C#, VB.NET Developer
Independent Consultant
www.RickHodder.com
MyBlog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform