You can let FoxPro handle it by disabling unavailable items with "\" prefix. See sample code below
PUBLIC ofrmListExamples
ofrmListExamples=NEWOBJECT("frmListExamples")
ofrmListExamples.Show
RETURN
DEFINE CLASS frmListExamples AS form
DataSession = 2
Top = 0
Left = 0
Height = 262
Width = 325
Caption = "List and ListItem Array Example"
Name = "frmListExamples"
ADD OBJECT cbolistitem AS combobox WITH ;
ColumnCount = 1, ;
ColumnWidths = "100,100,50", ;
Left = 34, ;
Sorted = .T., ;
Style = 2, ;
TabIndex = 3, ;
Top = 154, ;
Name = "cboListItem"
PROCEDURE cbolistitem.Init
WITH This
.AddItem( 'Apple' )
.AddItem( 'Banana' )
.AddItem( '\Carrot' )
.AddItem( 'Orange' )
ENDWITH
ENDPROC
ENDDEFINE
>
Note: Please excuse, I wrote Listbox in the subject, I meant Combobox.>
>Does anyone know if there is a way to make certain items within a combobox to display with a different forecolor then the rest of the items? I am trying to create a combobox that has a list of items, but based on other selections elsewhere on the form, certain items in the list of the combobox turn gray. Those gray items I would like to be able to "test" for so that I can disallow the selection of those items by the user interactively.
>
>If there is no way to do that with the existing combobox within FoxPro, does anyone know of an any other control I can maybe download and use that can accomplish this? Or maybe how to create such a control from scratch? Any help would be greatly appreciated.
--sb--