LOCAL o
o = Createobject("myform")
o.Show(1)
Define Class myform As Form
DoCreate = .T.
DataSession = 2
AutoCenter = .T.
Caption = "Trabajando con DyamicBackGround"
Width = 600
Height = 400
MinHeight = 300
MinWidth = 300
Add Object grid1 As Grid With ;
HEIGHT = This.Height, ;
WIDTH = This.Width, ;
DELETEMARK = .F.
Procedure Load
Select * From (_samples+"datacustomer") ;
Order By MaxOrdAmt Desc;
Into Cursor TmpCust
Use In "customer"
EndProc
Procedure Init
This.grid1.SetAll("dynamicbackcolor",;
"Thisform.GetBackColor(allt(country))")
EndProc
Procedure Resize
This.grid1.Width= This.Width
This.grid1.Height= This.Height
EndProc
Function GetBackColor(cCountry)
Local nColor
Do Case
Case cCountry == "Germany"
nColor = Rgb(255,255,255)
Case cCountry == "UK"
nColor = Rgb(224,224,0)
Case cCountry == "Sweden"
nColor = Rgb(224,224,160)
Case cCountry == "France"
nColor = Rgb(100,224,160)
Case cCountry == "Spain"
nColor = Rgb(100,224,160)
Otherwise
nColor = Rgb(224,100,224)
EndCase
Return nColor
EndFunc
EndDefine
Niciun comentariu:
Trimiteți un comentariu