回复 10楼mindrayguowei的帖子
禁止删除表格Table,需要自定义TX菜单,方法如下:
- private void Form1_Load(object sender, EventArgs e)
- {
- this.textControl1.Tables.Add(5, 5, 11);
- this.textControl1.TextContextMenuOpening += new TXTextControl.TextContextMenuEventHandler(textControl1_TextContextMenuOpening);
- }
- void textControl1_TextContextMenuOpening(object sender, TXTextControl.TextContextMenuEventArgs e)
- {
- ContextMenuStrip menu = e.TextContextMenu;
- for (int i = 0; i < menu.Items.Count; i++)
- {
- if (menu.Items[i].Text=="Delete")
- {
- menu.Items.RemoveAt(i);
- break;
- }
- }
- }
复制代码 |