I have a simple drag and drop module running which works fine between two list boxes, what I would like to see is the contents of what I am dragging to show at the mouse pointer while doing so . . is this possible ?
Sure it is.
Create a hidden control. When you go to grab the item that you want to drag, make the control visible and change it's value = to the value of the item you want to drag. Set the x and y coordinants of the item to move along with the mouse. When the user releases the mouse button, set the visibility to no and send the value to the place you want to drop. Maybe set a border around the area to drop in, if the mouse x/y corrdinants don't pass the border the item won't be placed in the "drop place" --perhaps if the person lets go of the mouse early or changes his/her mind.
Hope that's enough. Mark P.
Oh, by the way... I've done something simliar... I didn't mention it, but what turns out is not as pretty as dragging and dropping something in windows. You have to account for moving the mouse over other controls and such. So, although it's an interesting excersise, you might not want to do it unless its necessary part of making your app function. Not to disuade you, I use it and its coolio.
Create a form. Create an unbound image on the form, with no picture in it, name it: backing. Create 2 boxes, name then box X and Y.
Private Sub Backing_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Me!BoxX = x
Me!BoxY = y
End sub
I think everything i mentioned in the last post sort of required some research. Most of the things you can find in the help files, or are posted on this site. This site is how I figured it out myself. So run some searches on your questions, I'll help you out if you can find the answers though. Mark P.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.