Hello, lately I have been working on trying to add a custom context menu to the UltraTextEditor. I would like it to show a list of possible spelling error suggestions kind of similar to the MS word spell checker. To do this, I followed the sample from the documentation fairly closely, with the only major difference being that I used an UltraTextEditor instead of a RichTextBox. Here is a link to the sample I followed: Creating a Shortcut Menu to Resolve Spelling Errors - Infragistics Windows Forms Help. The problem I am having is this: If a user presses down the right click button while the mouse is in the UltraTextEditor, but then releases it while the mouse is outside the UltraTextEditor, it shows the default context menu. Any help with this issue would be greatly appreciated. Thanks.
Hello Riley ,
Thank you for your post . I followed the online doc link you provided and used UltraTextEditor control instead (as you suggested ), and I am not sure if I am able to reproduce the issue.
Here I attached my sample for your reference. And the steps I have taken is
1) I right click in the UltraTextEditor
2) Released it outside the UltraTextEditor.
And I found same exact context menu(not sure if it default). Let me know if this is the correct demonstration of your issue.
If not and your are getting different context menus then feel free to update my sample and send us back for further investigation.
Looking forward to her you back.
Regards,
Divya Jain
0257.WindowsFormsApp1.zip
Hi Divya,
Thanks for your response. I tried running your code, however, when I did, it didn't seem to display the customized context menu at all. It only ever showed the default version. Maybe this is because I am using a different version of infragistics than you? (I believe I am currently using version 19.2) I tried to look for a problem in your code, and I think I found it. You were setting the AlwaysInEditMode property to true before you assigned the cutomized context menu to the UltraTextEditor. This is a problem for the reasons detailed in the following forum post: (+) UltraTextEditor Context menu | Infragistics Forums. I think if you make this change, you should be able to reproduce my problem.
Thanks,
Riley Coulter
Please use our UltraFormattedTextEditor. The Microsoft textbox, which our UltraTextEditor is using, display the built-in context menu when mouse is moved away from the control even when a context menu strip is applied. Which I agree is odd and I couldn't find any feasible solution to turn off without impacting the custom context menu.
We can reproduce this behavior with the sample above, but it appears to be expected. The built-in textbox has a ShortcutsEnabled when set to false will disable all shortcuts including the built-in context menu and will continue to show the custom ContextMenuStrip on focus only (not away). The UltraTextEditor doesn't have the ability to turn off the built-in context menu unless you set the ContextMenu property to a new ContextMenu() without any items but this will prevent your custom context menu from appearing. The answer to your question is to use our UltraFormattedTextEditor as it doesn't show a default context menu on mouse away. It's possible we circumvented this issue when this particular control was created. So this appears to be the answer you are looking for.
Let me know if you have any questions.