Hello,
I would like to enable/disable clipboard buttons (cut, copy)s in a toolbar based on whether the user has selected text in a ultraTextEditor. Is there an event fired when the user changes the selected text. I actually only need an event to indicate whether there is selectedText or not.
Thanks
Wendy
No there is no event which will occur only when selected text is changed. If your cut, copy operation are in a popup menu of your toolbar, you could handle event like ToolClick or BeforeToolDropdow (if you are using UltratoolbarsManager) in order to check if editor has selected text and to disable/enable needed commands.
Please let me know if you have any further questions.
Thanks Hristo,
I had tried a few different events like PropertyChanged with different PropIds and nothing fired. For the ribbon buttons, I guess I'll use the user interaction event MouseUp on the embedded textbox which will catch most cases.
Does the Inbox TextBox control have an event for this? The Text editor uses a TextBox control and positions it over the tool. So if there is an event on the TextBox control itself, you could trap ControlAdded and get the TextBox, then hook it's events.
Thank you for your feedback, please let me know if you have any further questions regarding this matter.
Thank you for using Infragistics Components.
Hi Mike,
TextBox doesn't seem to have an event for SelectedText changes either. So, instead I've resorted to trapping the user actions that cause text to be selected (drag and double click) using MouseUp
((EditorWithText)myControl.Editor).TextBox.MouseUp += new MouseEventHandler(textBox_MouseUp);
and in the EventHandler use a bool to trap state changes for Had/HasSelectedText. Then, also trap code based changes to SelectedText to update the state bool.