Mouse dragging

Post

Posted
Rating:
#1 (In Topic #943)
Avatar
Guru
cogier is in the usergroup ‘Guru’
When I drag an image on the screen the mouse is positioned top left just outside the image. Is there a way to get the mouse cursor to be within the image being dragged?
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
Before calling the object.Drag() method you set Drag.IconX
Drag.IconY

I used this..

Code (gambas)

  1. Public sub MyObject_MouseMove()
  2. Drag.IconX = Mouse.ScreenX - Last.ScreenX
  3. Drag.IconY = Mouse.ScreenY - Last.ScreenY
  4. Drag.Icon = hDragPicture
  5. Last.Drag(sData, "text/plain")
  6.  

That made the mouse stay in the position it was at when the object was clicked.
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Guru
cogier is in the usergroup ‘Guru’
Thanks Bruce, that did the trick. I had tried the IconX and IconY but couldn't get them to work as I put them in the wrong place.
Online now: No Back to the top
1 guest and 0 members have just viewed this.