Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Draggable BitBlt Items
#2
Concept for this is pretty simple, but actually writing the code can be a bit of a pain so I'm too lazy to do tut.


Basicly, all you need to do is check where the mouse is being clicked, for example, if you click at the coord (200,300), you gotta check if 200 is between the left and right edges of the box area of which you want to drag, then check if 300 is between the top and bottom edges of the box area.

Then, when left click is down, when the mouse is moved, you move the rectangle which directs where to blt the thing, then you stop moving it again when left click is released

Code:
Sub MouseMove
if leftclick = true then
rect.left = Diff between old mouse coord and new mouse coord
rect.top = same thing as above
end if

You could store a reference to where on the rect was clicked on so you can move it acuratly, but I think i'd kinda start to confuse you if i tryed to explain it so all I can say is look into msdn for manually dragging objects (dont look at auto drag)
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)