Detecting Mouse Enter/Leave while dragging a file

So far, it seems that if the left button is already down, the state won't change as I drag a file over the object. Is there any way to check for this so that I can change state? OnMouseEnter is not called when entering with a dragged file.
23,560 views 1 replies
Reply #1 Top
Ah, the ever-problematic mouse enter/leave issues.

It's convoluted but this seems to work:

Code: vbscript
  1. Sub Object_OnScriptEnter
  2. 'object.settimer 1, 10
  3. End Sub
  4. Sub object_ontimer1
  5. 'Check where the cursor is
  6. newx= system.CursorX
  7. newy= system.CursorY
  8. 'Check where the object is
  9. l = object.Left
  10. r = object.Right
  11. t = object.Top
  12. b = object.Bottom
  13. 'Compare the 2 positions
  14. 'If mouse position not over object, hide object
  15. If newx < l Or newx > r Or newy < t Or newy > b Then
  16. Object.state = "mouse away"
  17. 'If mouse position over object, show object
  18. Else
  19. Object.state = "mouse over"
  20. End If
  21. End Sub


Here's the tutorial I made about this - Link

Here's another thread where some more DXers discussed solutions -WWW Link