Right-click the text box and open the properties window. In the properties, click events (as shown in the figure below) and double-click the MouseDown event.

This will create a method. Then enter the following code:
private void TextBox1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) {
For the left click, you can use the same method or add the MouceClick event, which fires only when the left mouse button is clicked.
If you need to change this ContextMenu , then highlight this: Add ContextMenu to the TextBox
source share