I would like to append a submenu to the default context menu that the UltraTextEditor has. The one that has undo, cut, paste, etc...
I need the ability to "quick add" text that they selected from the right click menu. But I've hit 2 problems:
thank you,
Gene
Hi Gene,
This menu is actually the menu on the inbox TextBox control. So there is no way to modify it as far as I know. You will probably need to create your own menu and replace the whole thing.
Hi Mike
Here is what I'm doing, but that doesn't work. It keeps showing me the default context menu.
What am I missing?
this.tbxMessage.ContextMenuStrip = new ContextMenuStrip();this.tbxMessage.ContextMenuStrip.Items.Add("Print");
That makes sense. Then the control goes into edit mode, it displays a TextBox control over itself to allow editing. It is at this point that it copies it's ContextMenu or ContextMenuStrip to the TextBox. So if you put the control into edit mode before it goes into edit mode, it will never get the new context menu.
Thank you for your reply... I got it.... My issue is related with the AlwaysInEditMode property. Quite a strange behaviour, I don't if it is because still using v7.3 (We will upgrade next month)
If you use the following code you can reproduce my issue.
this.TextBox1.AlwaysInEditMode = true;this.TextBox1.ContextMenuStrip = new ContextMenuStrip();this.TextBox1.ContextMenuStrip.Items.Add("Print");
Everything works fine when you write
this.TextBox1.ContextMenuStrip = new ContextMenuStrip(); this.TextBox1.ContextMenuStrip.Items.Add("Print");this.TextBox1.AlwaysInEditMode = true;
This works fine for me. I'm attaching a sample that uses your code.