NeGueSa
asked on
Different Colors in FoxPro Listbox
Is there any way to set different colors in a FoxPro ListBox
Select name, address, condition From Table into array ThisForm.pats
Where ThisForm.pats is an array pats[1,3]
The field condition has 3 values [a,b,c]
What I want is:
Do Case
Case pats[n,3 = a
Row forecolor = red
Case pats[n,3 = b
Row forecolor = green
Case pats[n,3 = c
Row forecolor = blue
EndCase
AFAIK, you can not do this with a Listbox. You will want to use a Grid for the look and feel you are looking for. There are several references on EE that describe how to do this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This is perfect solution with a little bit more complex Popup definition. Could you explain if it has some advantages against the grid?
Advantages? I don't see any. I was just answering the original question. But more complex? I don't that to be the case.
The Grid may have as much rows as you like, adding to the listbox will mean to add to the popup. I don't think that a popup will be fine when there are hundreds of rows, eg a popup isn't ment for so many items. Haven't tried to build such a popup, even as a Rowsource for a listbox. This RowsourceType 9 is for backward compatibility, regading the help topic on the RowSourceType Property.
But it works as you see. You can use DynamicFont... properties to also change font name,size, color and others in the Grid.
The advantage of the listbox is you have multiselect and moverbars, but moverbars won't work with RowSourceType 9.
Bye, Olaf.
But it works as you see. You can use DynamicFont... properties to also change font name,size, color and others in the Grid.
The advantage of the listbox is you have multiselect and moverbars, but moverbars won't work with RowSourceType 9.
Bye, Olaf.
I've requested that this question be deleted for the following reason:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I have recommended this question be closed as follows:
Not enough information to confirm an answer.
If you feel this question should be closed differently, post an objection and a moderator will read all objections and then close it as they feel fit. If no one objects, this question will be closed automatically the way described above.
Experts-Exchange Auto Deleter
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I have recommended this question be closed as follows:
Not enough information to confirm an answer.
If you feel this question should be closed differently, post an objection and a moderator will read all objections and then close it as they feel fit. If no one objects, this question will be closed automatically the way described above.
Experts-Exchange Auto Deleter
At least two answers contain code which allows to do what the question asks for. No reason to delete the question.
Select the ID: 23903632 and ID: 23906580 as a solution.
Select the ID: 23903632 and ID: 23906580 as a solution.