Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The event for middle mouse down and move

Tags:

c#

winforms

What is the control event for middle mouse down and move? That is, what is the event that I can subscribed to when I hold my middle mouse down and move the mouse?

like image 846
Graviton Avatar asked Dec 22 '22 07:12

Graviton


1 Answers

Have a look at

  • Control.MouseDown Event
  • MouseButton Enumeration
  • Detecting Mouse Button Events in C#

You can also try something like this

private void Form1_MouseMove(object sender, MouseEventArgs e)
{
    if (e.Button == MouseButtons.Middle)
    {
        label1.Text = String.Format("{0} :: {1}", e.X, e.Y);
    }
}
like image 98
Adriaan Stander Avatar answered Jan 02 '23 23:01

Adriaan Stander