When using a Windows TextBox it is fairly simple to override the Copy, Cut and Paste methods by overriding the WndProc method.
However, when overriding this method for an UltraTextEditor, the messages are not coming through (probably because the messages are being sent to the EmbeddableTextBoxWithUIPermissions?). I am basically inheriting the UltraTextEditor and creating a control that will accept certain types of characters based on a regular expression and I want to interrupt the Paste operation, in particular, so that any Text being pasted is validated beforehand.
Any ideas how I can override the Copy, Cut and Paste operations?
Hi,
The only thing I can think of would be to handle the key events and watch for Ctrl+V or Shift+Ins. You would also have to create your own context menu to replace the built-in one provided by Windows so you could handle Paste - and this means you would have to handle all of the other shortcuts like cut and copy, as well.
I was afraid you were going to say that :o( That's rubbish...
I am already overriding the key presses for Ctrl+C, etc.
And as for the context menu is concerned, I just let it do its stuff and validate before exiting Edit mode.
Oh well... I might put in a request to get these operations overridable.