Hello
I'm busy working with an MDI parent and child forms. I've found that there is a discrepancy between the locations returned by DesktopLocation , Control.MousePo sition and MouseEventArgs e.Location, but I can't work out why or what exactly the discrepancy is.
My forms are all custom without title bars and thus I've had to create my own moving methods, etc. This is obviously related to the location of the mouse pointer. My mouse events are generated by clicking on the child forms. It seems that MouseEventArgs returns a location relative to the form that was clicked. Seeing as I need locations in relation to the parent form as a whole, I've tried instead to use Control.MousePo sition. Unfortunately I've found that the locations of Control.MousePo sition and the DesktopLocation of the form seems to be different (ie a click in the top left corner of the form is not the same).
Does anyone know from where this discrepancy arises so I can correct for it, or of a better way to get the mouse position?
Thanks
I'm busy working with an MDI parent and child forms. I've found that there is a discrepancy between the locations returned by DesktopLocation , Control.MousePo sition and MouseEventArgs e.Location, but I can't work out why or what exactly the discrepancy is.
My forms are all custom without title bars and thus I've had to create my own moving methods, etc. This is obviously related to the location of the mouse pointer. My mouse events are generated by clicking on the child forms. It seems that MouseEventArgs returns a location relative to the form that was clicked. Seeing as I need locations in relation to the parent form as a whole, I've tried instead to use Control.MousePo sition. Unfortunately I've found that the locations of Control.MousePo sition and the DesktopLocation of the form seems to be different (ie a click in the top left corner of the form is not the same).
Does anyone know from where this discrepancy arises so I can correct for it, or of a better way to get the mouse position?
Thanks
Comment