*!* Code does not drill-down into container *!* objects. It is just a simple example showing *!* the basic principal of changing colors to *!* corresponding grayscale PUBLIC oform1 oform1=NEWOBJECT("form1") oform1.Show RETURN DEFINE CLASS form1 AS form Height = 250 Width = 336 DoCreate = .T. AutoCenter = .T. Caption = "Grayscale Example" Name = "Form1" ADD OBJECT text1 AS textbox WITH ; FontBold = .T., ; Value = ("This is a Test!"), ; Height = 25, ; Left = 17, ; Top = 50, ; Width = 301, ; ForeColor = RGB(0,0,255), ; Name = "Text1" ADD OBJECT edit1 AS editbox WITH ; FontBold = .T., ; Height = 58, ; Left = 17, ; Top = 86, ; Width = 301, ; ForeColor = RGB(255,0,0), ; Value = ("Hello World!"), ; Name = "Edit1" ADD OBJECT label1 AS label WITH ; AutoSize = .T., ; FontSize = 16, ; BackStyle = 0, ; Caption = "Visual FoxPro Rocks!", ; Height = 27, ; Left = 17, ; Top = 14, ; Width = 203, ; ForeColor = RGB(255,128,0), ; Name = "Label1" ADD OBJECT command1 AS commandbutton WITH ; Top = 204, ; Left = 149, ; Height = 27, ; Width = 84, ; Caption = "Gray", ; Enabled = .T., ; BackColor = RGB(255,255,0), ; Name = "Command1" ADD OBJECT command2 AS commandbutton WITH ; Top = 204, ; Left = 233, ; Height = 27, ; Width = 84, ; Caption = "Color", ; Enabled = .F., ; BackColor = RGB(0,255,0), ; Name = "Command2" ADD OBJECT shape1 AS shape WITH ; Top = 156, ; Left = 24, ; Height = 37, ; Width = 49, ; BackColor = RGB(255,0,0), ; Name = "Shape1" ADD OBJECT shape2 AS shape WITH ; Top = 156, ; Left = 84, ; Height = 37, ; Width = 49, ; BackColor = RGB(128,255,128), ; Name = "Shape2" ADD OBJECT shape3 AS shape WITH ; Top = 156, ; Left = 144, ; Height = 37, ; Width = 49, ; BackColor = RGB(0,128,0), ; Name = "Shape3" ADD OBJECT shape4 AS shape WITH ; Top = 156, ; Left = 204, ; Height = 37, ; Width = 49, ; BackColor = RGB(0,255,255), ; Name = "Shape4" ADD OBJECT shape5 AS shape WITH ; Top = 156, ; Left = 264, ; Height = 37, ; Width = 49, ; BackColor = RGB(255,0,128), ; Name = "Shape5" PROCEDURE command1.Click LOCAL loControl, lnRed, lnGreen, lnBlue, lnColor, lnGray loControl = .NULL. *!* Break each control's colors into three parts *!* by simple addition and division transform them into *!* corresponding grayscale color FOR EACH loControl IN thisform.Controls IF PEMSTATUS(loControl,"Backcolor",5) lnColor = loControl.BackColor loControl.Tag = TRANSFORM(lnColor) lnRed = Mod(lnColor, 256) lnGreen = Mod(BitRShift(lnColor, 8), 256) lnBlue = Mod(BitRShift(lnColor, 16), 256) lnGray = (lnRed + lnGreen + lnBlue)/3 loControl.BackColor = RGB(lnGray, lnGray, lnGray) ENDIF loControl.Tag = loControl.tag + "." IF PEMSTATUS(loControl,"ForeColor",5) lnColor = loControl.ForeColor loControl.Tag = loControl.tag + TRANSFORM(lnColor) lnRed = Mod(lnColor, 256) lnGreen = Mod(BitRShift(lnColor, 8), 256) lnBlue = Mod(BitRShift(lnColor, 16), 256) lnGray = (lnRed + lnGreen + lnBlue)/3 loControl.ForeColor = RGB(lnGray, lnGray, lnGray) ENDIF ENDFOR this.Enabled = .F. thisform.command2.Enabled = .T. ENDPROC PROCEDURE command2.Click LOCAL loControl loControl = .NULL. FOR EACH loControl IN thisform.Controls IF !EMPTY(loControl.tag) IF PEMSTATUS(loControl,"Backcolor",5) loControl.BackColor = INT(VAL(JUSTSTEM(loControl.tag))) ENDIF IF PEMSTATUS(loControl,"ForeColor",5) loControl.ForeColor = INT(VAL(JUSTEXT(loControl.tag))) ENDIF ENDIF loControl.tag = "" ENDFOR this.Enabled = .F. thisform.command1.Enabled = .T. ENDPROC ENDDEFINE>Hi Christof,