I'm using this code below but it doesn't work like I want it and I have no idea how to actually make it.
What I want it to do is get the mouse coordinates onClick
, but this happens after the user confirm a messagebox.
MessageBox > User Click OK > User Click anywhere on screen > Get the coordinates
Should I start a timer at the "OK button"? What I do on timer code to wait for a mouse response?
This is what I have now (which shows the mouse position when I click OK button):
private void button12_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Pick a position after clicking OK", "OK", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) == DialogResult.OK)
{
// user clicked ok
MouseEventArgs me = (MouseEventArgs)e;
Point coordinates = me.Location;
MessageBox.Show("Coordinates are: " + coordinates);
}
}