DEFINE CLASS form1 AS form DoCreate = .T. Caption = "Form1" Name = "Form1" ADD OBJECT command1 AS commandbutton WITH ; Top = 36, ; Left = 48, ; Height = 27, ; Width = 84, ; Caption = "Command1", ; Name = "Command1" ADD OBJECT command2 AS commandbutton WITH ; Top = 72, ; Left = 48, ; Height = 27, ; Width = 84, ; Caption = "Command2", ; Name = "Command2" PROCEDURE shrink LPARAMETERS toObj DECLARE INTEGER Sleep IN WIN32API INTEGER t = toObj.top l = toObj.left h = toObj.height w = toObj.width #define kRate 10 dw = w/kRate dh = h/kRate WITH toObj FOR i=kRate TO 0 STEP -1 .top = .Top + dh .left = .left + dw .height = MAX(0, .height - (dh*2)) .width = MAX(0, .width - (dw*2)) .refresh sleep(200) NEXT .visible = .f. * reset for when it is made visible again. .top = t .left = l .height = h .width = w ENDWITH ENDPROC PROCEDURE command1.Click thisform.command2.Visible = .t. thisform.shrink(this) ENDPROC PROCEDURE command2.Click thisform.command1.Visible = .t. thisform.shrink(this) ENDPROC ENDDEFINE