You are on page 1of 4

C# Get Mouse Coordinates

How To Get Cursor Position In C# 

Shares

(https://2.bp.blogspot.com/-

C_fyiLlOT0E/WFpkcfJI39I/AAAAAAAACLo/A3ZVKPg_X74K8VJH83L_I2eAs7qr6t-hwCLcB/s1600/C%2523%2BGet%2BMouse%2BCoordinates.png)

In This C# (http://1bestcsharp.blogspot.com/search/label/c%23) Tutorial  We Will See How To Get Mouse Coordinates [X ; Y]


In CSharp (http://1bestcsharp.blogspot.com/search/label/c%23) Programming Language.
C# - How To Get Mouse Coordinates In C# [ with source code ]

Shares

Project Source Code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class FormMouseCR : Form
  {
        public FormMouseCR()
    {
            InitializeComponent();
    }

        private void FormMouseCR_MouseClick(object sender, MouseEventArgs e)


    {
            label1.Text = "X = " + e.X + " ; Y = " + e.Y;
    }
Shares

        private void FormMouseCR_MouseMove(object sender, MouseEventArgs e)


    {
            label1.Text = "X = " + e.X + " ; Y = " + e.Y;
    }

  }
}

// OUTPUT :
(https://3.bp.blogspot.com/-

Shares

JzTi6q2c1Ao/WFpkVzn3QKI/AAAAAAAACLk/PkEtUedX9NY-3ixLGSu33Kd4KVfEvw3FACLcB/s1600/c%2523%2Bmouse%2Bcoordinates.PNG)

More C#
➜ C# Courses
(http://1bestcsharp.blogspot.com/2016/03/c-
course-csharp.html)

➜ C# Projects
(http://1bestcsharp.blogspot.com/p/c-
programming-projects.html)

You might also like