Drag and Drop questions... :)

Goksly

Freshman
Joined
Aug 8, 2005
Messages
26
Hi again :)
Right a few (hopefully simple) questions in regard to drag drop.
What i want to do is drag an item from a list view on a panel. On the item being dropped the text in the item (which refers to a table) is taken and used to create an ERD item control.
Now I have this working, however I cant find the mouse position in regards to the panel! When I drop the item onto the panel, its meant to create the control at the point, but its missing by a mile and ive discovered the x and y properties from the dragevent is around the whole programs 0,0!
So my first questions is.... how can i find out the proper place to draw the item... is there a way to find the mouses position on the panel and not the whole program in the dragdrop event?

My second question.... dragdropeffect -> does this only affect the icon and nothing else, or is there some more stuff being run in the background that should affect which one i chose?

Thanks :)
 
You'll need to first locate the x,y coordinates of the panel in relationship to your form. Then subtract these from the mouse location in the panel to get the actual coordinates of the object in the panel. Also, you'll need to account for the panel's scroll position if it is used when adjusting from form coordinates to panel coordinates.
 
Back
Top