472,805 Members | 4,093 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

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 4406
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: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.