473,473 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Mouse Position While Dragging and Dropping

I am trying to make a little diagramming app in C# with the 1.1
Framework (currently our standard here at work, will be upgrading to
2005 sometime in the next couple of months). I want to allow them to
click on a custom control of mine, drag a line to another custom
control, and when they let go draw a connection.

With Drag and Drop I am able to get the start and end controls, and
draw the final connection line, but I cannot for the life of me figure
out how to get the mouse position during the process. Without Drag and
Drop I can capture the mouse and get the position and draw the dynamic
line as you move around, but when you let go I can't seem to figure
out how to tell which control it was over.
>From what I have read, I might be able to do this with the 3.0
Framework, but I was wondering if there was some way I'm not thinking
of that would allow me to do it with the 1.1 version. Any help is
appreciated!

Feb 1 '07 #1
1 4471
On 1 Feb, 16:28, "Emanuel" <emanue...@gmail.comwrote:
I am trying to make a little diagramming app in C# with the 1.1
Framework (currently our standard here at work, will be upgrading to
2005 sometime in the next couple of months). I want to allow them to
click on a custom control of mine, drag a line to another custom
control, and when they let go draw a connection.

With Drag and Drop I am able to get the start and end controls, and
draw the final connection line, but I cannot for the life of me figure
out how to get the mouse position during the process. Without Drag and
Drop I can capture the mouse and get the position and draw the dynamic
line as you move around, but when you let go I can't seem to figure
out how to tell which control it was over.
From what I have read, I might be able to do this with the 3.0

Framework, but I was wondering if there was some way I'm not thinking
of that would allow me to do it with the 1.1 version. Any help is
appreciated!

Console.WriteLine(Cursor.Position.ToString());

Console.WriteLine(PointToClient(Cursor.Position).T oString());

The first gets the cursors position relative to the screen, and the
latter converts it to coordinates local to the client.

Feb 1 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: gsb | last post by:
I track the mouse location like this code: function mousePos(e) { var p = new Object(); if(e) { p.x = e.pageX; p.y = e.pageY; } else { p.x = event.x; p.y = event.y; } ... (show) }...
8
by: NeoAsimov | last post by:
Hello, There is what I want to do. I worked on the problem since 6 hours but I had a problem (probably stupid) and I dont know how to resolve it. I need to have an Mouse Event Click when...
2
by: Christian Blackburn | last post by:
Hi Gang, I would like to be able to drag and drop documents onto my application and have them open immediately thereafter. Can somebody point me towards a KB article or example? I could find a...
6
by: Sakharam Phapale | last post by:
Hi All, How to move the CommandButton control using mouse from one position to other? Is it possible using Drag, Drop events or I have to write my own code for that? I have set the...
1
by: ohadasor | last post by:
Hello, I have a control which I need to act in a specific way when the user drags the mouse on it. Means, that the user should click on the control's one position, hold the mouse button, move it...
7
by: David McDivitt | last post by:
On my page I have a div appear, positioned next to the cursor, after dragging and dropping. The div contains radio buttons for what action is to be performed. A person selects which radio button...
2
by: markszlazak | last post by:
In the following script, a control displays (black box) in each table cell once you mouse over the cell. Mouse down on the control to change the mode of the table. Drag the mouse over cells in the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.