Mouse dragging
- cogier
- Site Admin
- Posts: 1125
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Mouse dragging
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?
- BruceSteers
- Posts: 1572
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Mouse dragging
Before calling the object.Drag() method you set Drag.IconX
Drag.IconY
I used this..
That made the mouse stay in the position it was at when the object was clicked.
Drag.IconY
I used this..
Public sub MyObject_MouseMove()
If Mouse.Left then
Drag.IconX = Mouse.ScreenX - Last.ScreenX
Drag.IconY = Mouse.ScreenY - Last.ScreenY
Drag.Icon = hDragPicture
Last.Drag(sData, "text/plain")
Endif
End
That made the mouse stay in the position it was at when the object was clicked.
If at first you don't succeed , try doing something differently.
BruceS
BruceS
- cogier
- Site Admin
- Posts: 1125
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Mouse dragging
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.