How can I realize the movement of the rectangles with the mouse on the form? I draw a few rectangles and at any moment I can choose any of them and to displace its position with the mouse.
Asked
Active
Viewed 144 times
1
-
1What have you done so far?If you expect us to write the code for you it won't happen. We will help you if something goes wrong on your code. – Praburaj Dec 22 '16 at 11:02
-
check Drag and Drop with C#, there is loads of tutorials – madoxdev Dec 22 '16 at 11:09
-
Basically you need to use HitTest approach. There are few eamples of that both in WinForms or WPF frameworks – VitaliyK Dec 22 '16 at 11:13
-
[See here](http://stackoverflow.com/questions/32919918/how-to-draw-line-and-select-it-in-panel/32920894?s=1|1.4514#32920894) for an example that should help understand what you need to do. It uses Lines but there is really not much of a difference to any other shape.. It will involve much more that coloring pixels.. And no, drag-and-drop is not the best way to approach the problem. – TaW Dec 22 '16 at 15:58