When we write client applications, we often use the current position of the mouse. In C# winform, you can useObtain the coordinates of the current mouse and use PointToClient to calculate the coordinates of the mouse relative to a control, as follows
Point screenPoint = ;//The coordinates of the mouse relative to the upper left corner of the screen
Point formPoint = ();//The coordinates of the mouse relative to the upper left corner of the form
Point contextMenuPoint = ();//The coordinates of the mouse relative to the upper left corner of contextMenuStrip1
Point screenPoint = ;//The coordinates of the mouse relative to the upper left corner of the screen
Point formPoint = ();//The coordinates of the mouse relative to the upper left corner of the form
Point contextMenuPoint = ();//The coordinates of the mouse relative to the upper left corner of contextMenuStrip1