Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show Contents While Dragging

Status
Not open for further replies.

leckie

Programmer
Apr 19, 2001
65
0
0
GB
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 ?

in anticipation . .

Gez

 
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.

Bleh
 
Thanks Mark,

how do you "Set the x and y coordinants of the item to move along with the mouse " ?

regards
Gez
 
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.

Bleh
 
Thanks mark

will let you know . .

regards
Gez
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top