c# - How can i get form1 location when dragging the form around when the form is transparent? -


i want in real time form1 location when drag form around. since form transparent can drag on it's borders.

i tried:

using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.drawing.imaging; using system.linq; using system.runtime.interopservices; using system.text; using system.threading.tasks; using system.windows.forms;  namespace form_location {     public partial class form1 : form     {         private point mousedownlocation;          public form1()         {             initializecomponent();              backcolor = color.lightgreen;             transparencykey = color.lightgreen;             this.topmost = true;         }          private void form1_load(object sender, eventargs e)         {          }          private void form1_mousedown(object sender, mouseeventargs e)         {             if (e.button == system.windows.forms.mousebuttons.left)             {                 mousedownlocation = e.location;             }         }          private void form1_mousemove(object sender, mouseeventargs e)         {             if (e.button == system.windows.forms.mousebuttons.left)             {                 point p = e.location;             }         }     } } 

first code not right tried when form not reansparent it's not giving me location when dragging form.

second problem when form transparent can't click events on form. event/s form1_mousedown , form1_mousemove not working.

i want x , y of form1 location while dragging form around in real time.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -