C#-在TextBox中禁用鼠标右键

it2022-05-05  183

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;

namespace EnjoinRMKeyInTXT {     public partial class Frm_Main : Form     {         public Frm_Main()         {             InitializeComponent();         }

        private void textBox1_MouseDown(object sender, MouseEventArgs e)         {             if (e.Button == MouseButtons.Right)//如果按下鼠标右键             {                 textBox1.ContextMenu = new ContextMenu();//初始化右键菜单             }         }     } }


最新回复(0)