public oForm oForm = createobject( "frmColorPick" ) oForm.Visible = .t. define class frmColorPick as Form nColor = 0 Width = 268 Height = 400 function Init() local lnR, lnG, lnB, lnTop, lnLeft, lnId lnTop = 1 lnLeft = 1 lnId = 0 for lnR = 0 to 256 step 51.19 for lnG = 0 to 256 step 51.19 for lnB = 0 to 256 step 51.19 lcName = "shp" + padl( lnId, 3, "0" ) this.AddObject( lcName, "shpColorPick" ) with evaluate( "this." + lcName ) .Top = lnTop .Left = lnLeft .FillColor = rgb( int( lnR ), int( lnG ), int( lnB ) ) .Visible = .t. lnLeft = lnLeft + 22 if ( lnLeft > 264 ) lnLeft = 1 lnTop = lnTop + 22 endif endwith lnId = lnId + 1 endfor endfor endfor endfunc enddefine define class shpColorPick as Shape Width = 20 Height = 20 FillStyle = 0 function Click() thisform.nColor = this.FillColor thisform.Caption = transform( thisform.nColor ) endfunc enddefine