How to use right click mouse event in C#

1 Answer

0 votes
namespace WinFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                label1.Text = "MouseButtons.Right";
            }
        }
    }
}




/*
 * run:
 *
 * MouseButtons.Right
 * 
 */


 



answered Aug 12, 2023 by avibootz
...