Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a better way to show my true colors in a combobox?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Is there a better way to show my true colors in a combobox?
Miscellaneous
Thread ID:
00453959
Message ID:
00453959
Views:
62
I populated a combobox on a form with 7 rows of differing bands of colors in the drop-down list for color coding purposes and my code to populate the combobox drop-down list is as follows:
WITH THISFORM.cboBroselow
	.AddItem("",.ListCount+1)
	.PICTURE(1) = "\arrest\red.bmp"
	.AddItem("",.ListCount+1)
	.PICTURE(2) = "\arrest\purple.bmp"
	.AddItem("",.ListCount+1)
	.PICTURE(3) = "\arrest\yellow.bmp"
	.AddItem("",.ListCount+1)
	.PICTURE(4) = "\arrest\white.bmp"
	.AddItem("",.ListCount+1)
	.PICTURE(5) = "\arrest\blue.bmp"
	.AddItem("",.ListCount+1)
	.PICTURE(6) = "\arrest\orange.bmp"
	.AddItem("",.ListCount+1)
	.PICTURE(7) = "\arrest\green.bmp"
ENDWITH
I am looking for a way to show the chosen item's color that matches the .bmp in the combobox displayvalue window. Right now I am doing the YELLOW color band as follows in the Interactive change event of the comobox I have the following code (I would being doing something similar for ListIndex 1 thru 7 for all 7 differing color bands):
IF THIS.ListIndex = 3
	THIS.BackColor = RGB(255,255,0)
	THIS.DisabledBackColor = RGB(255,255,0)
ENDIF
I am thinking there must be a better way to take the .BMP color from the drop-down list and display it in the comboxbox displayvalue window than the way I am doing it in my above example. Let me know. Thanks so much.

I appreciate everyone's ideas that were sent to me on how to approach this problem as far as loading the control on a form with color bands in a drop-down list. Thanks again for helping me improve my code.
Steve Kramer
Kramer & Kramer Design
"Home of Go Cartoons"
Web Site: www.stephenkramer.com
Would you believe Far Side Lite?
More than 270 original cartoons.
Next
Reply
Map
View

Click here to load this message in the networking platform