This test the mouse right button click. But now I want to test when I click and hold down the right mouse button and also drag the mouse around.
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 Mouse_Test
{
public partial class Form1 : Form
{
private int numClicks = 0;
public Form1()
{
InitializeComponent();
label1.Text = "0";
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
if(e.Button == MouseButtons.Right)
{
numClicks++;
label1.Text = numClicks.ToString();
}
}
}
}
For example draw a line on the form1 only when holding down the right mouse button and dragging the mouse around.
