How to remove the default context menu of a TextBox Control? C#

后端 未结 3 583
感动是毒
感动是毒 2021-02-04 08:36

How to remove the default context menu of a TextBox Control?

\"alt

Is there a propert

3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-04 09:05

    This works:

    public partial class Form1 : Form
    {
        ContextMenu blah = new ContextMenu();
        public Form1()
        {
            InitializeComponent();
        }
    
        private void Form1_Load(object sender, EventArgs e)
        {
            textBox1.ContextMenu = blah;
        }
    }
    

提交回复
热议问题