**!* GridwithborderByYousfi - variant without resize method and without the picture Public oform oform1=Newobject("ygrid_border_color") oform1.Show Read Events Return * Define Class ygrid_border_color As Form Height = 296+40 Width = 700 ShowWindow = 2 AutoCenter = .T. ShowTips=.T. ScaleMode=3 Caption = "Click shapes to change random color, pîcture or container borderWidth.can resize the form/grid" Name = "Form1" Add Object container1 As ycont With ; Anchor = 15, ; Top = 12, ; Left = 30, ; Width = 655, ; Height = 265, ; BackStyle = 0, ; BorderWidth = 4, ; MousePointer = 15, ; BorderColor = Rgb(255,128,64), ; Name = "Container1" Add Object shape1 As Shape With ; Top = 300+14, ; Left = 50, ; Height = 13, ; Width = 13, ; Anchor = 768, ; Curvature = 99, ; MousePointer = 15, ; ToolTipText = "Change random border color (or click on container border)", ; BackColor = Rgb(255,0,0), ; Name = "Shape1" Add Object shape2 As Shape With ; Top = 300+14, ; Left = 70, ; Height = 13, ; Width = 13, ; Anchor = 768, ; Curvature = 99, ; MousePointer = 15, ; ToolTipText = "Change container picture(empty=no picture)", ; BackColor = Rgb(0,0,255), ; Name = "Shape2" Add Object spinner1 As Spinner With ; Height = 24,; KeyboardHighValue = 20,; KeyboardLowValue = 0,; Left = 90,; SpinnerHighValue = 20.00,; SpinnerLowValue = 0.00,; Top = 295+14,; Width = 48,; Anchor=768,; Value=4,; ToolTipText="container borderwidth (px)",; Name = "Spinner1" Procedure shape1.Click Rand(-1) Thisform.container1.BorderColor=Rgb(255*Rand(),255*Rand(),255*Rand()) Endproc Procedure shape2.Click With Thisform.container1 .Picture=Getpict() .BackStyle=1 Thisform.Resize() Endwith Endproc Procedure spinner1.InteractiveChange With Thisform.container1 .BorderWidth= This.Value .Parent.Resize() Endwith Endproc Procedure Load Close Data All Sele * From Home(1)+"samples\data\customer" Into Cursor ycurs Readwrite Sele ycurs Endproc Procedure Destroy Clea Events Endproc Enddefine * *-- EndDefine: ygrid_border_color *********************************** * Define Class ycont As Container Anchor = 15 Top = 12 Left = 10 Width = 655 Height = 265 BackStyle = 0 BorderWidth = 4 MousePointer = 15 BorderColor = Rgb(255,128,64) Name = "Container1" Add Object grid1 As Grid With ; Anchor = 15, ; Height = 193, ; Left = 13, ; Top = 14, ; Width = 543, ; Name = "Grid1" Procedure Click Rand(-1) This.BorderColor=Rgb(255*Rand(),255*Rand(),255*Rand()) Endproc Procedure grid1.Init With This .RecordSource="ycurs" .RecordSourceType=1 .DeleteMark=.F. .RecordMark=.F. .HighlightStyle=2 .GridLines=0 .FontSize=11 .FontName="Courier new" .SetAll("DynamicBackColor", "IIF(MOD(RECNO(), 2) = 0, RGB(255, 255, 255), RGB(255, 255, 190) )","column") .Refresh Endwith Endproc Enddefine * *-- EndDefine: ycont ***********************Regards,