DEFINE CLASS mybutton AS container Width = 108 Height = 34 SpecialEffect = 0 BackColor = RGB(255,255,0) Name = "mybutton" ADD OBJECT command1 AS commandbutton WITH ; Top = 0, ; Left = 1, ; Height = 27, ; Width = 84, ; Caption = "Command1", ; Style = 1, ; Name = "Command1" ADD OBJECT label1 AS label WITH ; WordWrap = .T., ; BackStyle = 0, ; Caption = "Label1", ; Height = 53, ; Left = 27, ; Top = 3, ; Width = 74, ; Name = "Label1" ADD OBJECT image1 AS image WITH ; Height = 21, ; Left = 4, ; Top = 5, ; Width = 21, ; Name = "Image1" ADD OBJECT shape1 AS shape WITH ; Top = 4, ; Left = 5, ; Height = 26, ; Width = 98, ; BackStyle = 0, ; BorderStyle = 0, ; Name = "Shape1" PROCEDURE MouseMove LPARAMETERS nButton, nShift, nXCoord, nYCoord #DEFINE threshhold 8 IF nButton = 0 IF between(nXCoord, this.left + threshhold, this.left + this.width - threshhold ) ; and between(nYCoord, this.top + threshhold, this.top + this.height - threshhold) this.backcolor = rgb(255,0,0) ELSE this.resettodefault("backcolor") ENDIF ENDIF ENDPROC PROCEDURE MouseUp LPARAMETERS nButton, nShift, nXCoord, nYCoord IF nButton = 1 this.visible = .f. this.specialeffect = 0 this.visible = .t. ENDIF ENDPROC PROCEDURE MouseDown LPARAMETERS nButton, nShift, nXCoord, nYCoord IF nButton = 1 this.visible = .f. this.specialeffect = 1 this.visible = .t. ENDIF ENDPROC PROCEDURE command1.Click this.parent.click ENDPROC PROCEDURE command1.Init WITH this .top = 1 .left = 1 .width = .parent.width - 2 .height = .parent.height - 2 ENDWITH ENDPROC PROCEDURE command1.GotFocus this.parent.backcolor = rgb(255,0,0) this.parent.shape1.borderstyle = 3 ENDPROC PROCEDURE command1.LostFocus this.parent.resettodefault("backcolor") this.parent.shape1.borderstyle = 0 ENDPROC PROCEDURE shape1.Init WITH this .top = 4 .left = 5 .width = .parent.width - 10 .height = .parent.height - 8 ENDWITH ENDPROC PROCEDURE shape1.MouseMove LPARAMETERS nButton, nShift, nXCoord, nYCoord this.parent.mousemove(nButton, nShift, nXCoord, nYCoord) ENDPROC PROCEDURE shape1.MouseUp LPARAMETERS nButton, nShift, nXCoord, nYCoord this.parent.mouseup(nButton, nShift, nXCoord, nYCoord) ENDPROC PROCEDURE shape1.MouseDown LPARAMETERS nButton, nShift, nXCoord, nYCoord this.parent.mousedown(nButton, nShift, nXCoord, nYCoord) ENDPROC PROCEDURE shape1.Click this.parent.click ENDPROC ENDDEFINECetin