Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Dragging and Dropping

Posted on 1999-07-01
4
Medium Priority
?
194 Views
Last Modified: 2010-05-02
How can I drop an item onto a form when the user has dragged it. For a control such as a picture, I use picture1.drag to make the shadow of the box follow the mouse. I want to make the object stay where the user clicks the mouse. I have tried using picture1.left = X and picture1.top = Y (where X and Y are the mouse pointer coordinates), but the object will move because the X and Y coordinates are never in the same place as where the x and y coordinates of the box are measured. Is there an easy command to drop the object?
0
Comment
Question by:mi5
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 1

Expert Comment

by:phiro
ID: 1521271
How do you mean never the same?
Does the box seem to jump when you drop it? Or does the box appear at random somewhere on the form?
The mouse uses screen coordinaties wheras the Picture.left and top use their coordinates relative to the Form coordinates. So you would have to correct by putting:
picture1.Top = mouse.y - (form.Top -1 ) and Picture1.Left = mouse.x - (form.Left -1) (Look whether the -1 is needed in your case... )
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1521272
Delete this question, you've posted it twice!

phiro - see
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=10177535 
0
 
LVL 1

Expert Comment

by:phiro
ID: 1521273
See what you mean. Thanx carag_g.
0
 
LVL 6

Accepted Solution

by:
VBGuru earned 100 total points
ID: 1521274
use dragicon property
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question