スペースバーを押すと、マウス座標取得
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 getXYmouse { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_KeyPress(object sender, KeyPressEventArgs e) { label3.Text = (System.Windows.Forms.Cursor.Position.X).ToString(); label4.Text = (System.Windows.Forms.Cursor.Position.Y).ToString(); } } }
コメント