473,569 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ 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 4483
On 1 Feb, 16:28, "Emanuel" <emanue...@gmai l.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.WriteLi ne(Cursor.Posit ion.ToString()) ;

Console.WriteLi ne(PointToClien t(Cursor.Positi on).ToString()) ;

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
7938
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) } document.onmousemove=mousePos; Seems to do fine on many browsers.
8
12651
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 I click on the frame of a window form ( like the title bar of a window).
2
1435
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 lot of examples pertaining to dragging and dropping objects within a form, but nothing about dragging external documents over a form. Thanks in...
6
7889
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 "AllowDrop" property to true. But when I try to drag the Button it doesn't move. Any help will be appreciated.
1
1791
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 to another position on the control, and releases the mouse. It isn't like drag and drop, when two objects are interacting. Here I have only one...
7
3787
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 and clicks OK, or clicks cancel. I want to restrict mouse motion to stay within the div, if the div is visible. There is also an iframe under the...
2
3122
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 same column then mouseup anywhere in a cell. The mouseup event sometimres fires before the selection of table cells by dragging is complete. It's...
0
7615
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8130
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
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 we have to send another system
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.