PUBLIC oform1 > >oform1=NEWOBJECT("form1") >oform1.Show >RETURN > >DEFINE CLASS form1 AS form > > DoCreate = .T. > Caption = "Form1" > Name = "Form1" > > ADD OBJECT line1 AS lineex WITH ; > BorderWidth = 3, ; > Height = 156, ; > Left = 60, ; > Top = 48, ; > Width = 132, ; > Name = "Line1" > > ADD OBJECT line2 AS lineex WITH ; > BorderWidth = 3, ; > Height = 120, ; > Left = 204, ; > Top = 24, ; > Width = 156, ; > LineSlant = "/", ; > Name = "Line2" >ENDDEFINE > >DEFINE CLASS lineex as Line > > PROCEDURE MouseMove > PARAMETERS nButton, nShift, nXCoord, nYCoord > LOCAL lnFullX, lnFullY, lnCurrentX > lnFullX = this.Width > lnFullY = this.height > lnCurrentXPercentage = (nXCoord - this.Left)/lnFullX > > IF This.LineSlant = "/" > lnCurrentXPercentage = (1 - lnCurrentXPercentage) > ENDIF > > *!* Is mouse directly over the line? > *!* if so, color it red > IF BETWEEN((nYCoord - this.Top) / lnCurrentXPercentage, lnFullY - this.BorderWidth, lnFullY + this.BorderWidth) > this.BorderColor = RGB(255,0,0) > ELSE > this.BorderColor = RGB(0,0,0) > ENDIF > ENDPROC >ENDDEFINE>
PUBLIC oform1 ACTIVATE WINDOW "debug output" oform1=NEWOBJECT("form1") oform1.Show RETURN DEFINE CLASS form1 AS form DoCreate = .T. Caption = "Form1" Name = "Form1" ADD OBJECT line1 AS lineex WITH ; BorderWidth = 3, ; Height = 156, ; Left = 60, ; Top = 48, ; Width = 132, ; Name = "Line1" ADD OBJECT line2 AS lineex WITH ; BorderWidth = 3, ; Height = 120, ; Left = 204, ; Top = 24, ; Width = 156, ; LineSlant = "/", ; Name = "Line2" ENDDEFINE DEFINE CLASS lineex as Line PROCEDURE MouseMove PARAMETERS nButton, nShift, nXCoord, nYCoord LOCAL lnFullX, lnFullY, lnCurrentX lnFullX = this.Width lnFullY = this.height lnCurrentXPercentage = (nXCoord - this.Left)/lnFullX IF This.LineSlant = "/" lnCurrentXPercentage = (1 - lnCurrentXPercentage) ENDIF *!* Is mouse directly over the line? *!* if so, color it red IF BETWEEN((nYCoord - this.Top) / lnCurrentXPercentage, lnFullY - this.BorderWidth, lnFullY + this.BorderWidth) this.BorderColor = RGB(255,0,0) ELSE this.BorderColor = RGB(0,0,0) ENDIF * I don't owe I can be above to a black point IF thisform.Point(m.nXCoord, m.nYCoord)=0 DEBUGOUT m.nXCoord, m.nYCoord ENDIF ENDPROC ENDDEFINEThis show the solution way, also :)