winform 获取鼠标的位置

        public Form1()
        {
            InitializeComponent();
            this.label1.Text = Cursor.Position.X.ToString();
            this.label2.Text = Cursor.Position.Y.ToString();
        }
        private void label1_MouseMove(object sender, MouseEventArgs e)
        {
            this.label1.Text = e.X.ToString();
            this.label2.Text = e.Y.ToString();
        }
        public Form1()
        {
            InitializeComponent();
            this.label1.Text = Cursor.Position.X.ToString();
            this.label2.Text = Cursor.Position.Y.ToString();
        }
        private void label1_MouseMove(object sender, MouseEventArgs e)
        {
            this.label1.Text = e.X.ToString();
            this.label2.Text = e.Y.ToString();
        }
展开阅读全文

没有更多推荐了,返回首页