According to MSDN's instructions and usual habits, we want to get the relative coordinates of mouse click, will use MouseClick and other events, today, accidentally found that the original click event can also.
* * Archaeological achievements of the world of ghosts and spirits.
* The original Cilck event can also get the current coordinates of the mouse click, MSDN said to use the MouseClick event, haha * The original Click event can also ...
* However, if an event is raised through the keyboard and not through the mouse, you cannot get it.
* The right mouse click is not valid.
*/using System;
Using System.Collections.Generic;
Using System.ComponentModel;
Using System.Data;
Using System.Drawing;
Using System.Linq;
Using System.Text;
Using System.Windows.Forms;
namespace WindowsFormsApplication1 {public partial class Form1:form {public Form1 () {
InitializeComponent ();
This.button1.Click + = (s, e) = = {try { MessageBox.Show ("Event Source Type:" + s.gettype (). ToString () + "\ n" + "event parameter type:" + e.gettype (). ToString () + "\ n" + "mouse click X coordinate:" + ((MouseEventArgs) e). X.tostring () + "\ n" + "y-coordinate:" + ((MouseEventArgs) e). Y.tostRing ()); } catch {MessageBox.Show ("You may trigger the event via the ENTER key and cannot get the data.
");
}
}; }
}
}