The event for middle mouse down and move

前端 未结 1 1751
余生分开走
余生分开走 2021-01-14 18:49

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?

1条回答
  •  执笔经年
    2021-01-14 19:13

    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);
        }
    }
    

    0 讨论(0)
提交回复
热议问题