Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 :)

  • *Experts*
Posted
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.

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...