Products
RapidSpell Desktop .NET (Win Forms)
RapidSpell Web ASP.NET (ASP.NET, MVC, SPA)
RapidSpell WPF
RapidSpell Web Java (JSP, JSF)
RapidSpell Desktop Java (Swing)
SearchUnit
RapidFindReplace WPF
Dictionaries for .NET
Dictionaries for Java
Conveyor
Customer Care
Existing Customers
Support
Knowledge Base
Company
Home
About
Blog
Contact Us
Refund Policy
Support Policy
Privacy Policy
Home
KB
Knowledgebase Home Page
>
RapidSpell Desktop .NET
>
Appearance Customization
Search the Knowledge Base
-- Select a Category --
- RapidFindReplace WPF
- RapidSpell Desktop .NET
- 3rd Party Ctrls
- Appearance Customization
- Behavior Customization
- Misc
- Troubleshooting
- RapidSpell Desktop Java
- RapidSpell Silverlight
- RapidSpell Web ASP.NET
- Appearance Customization
- Behavior Customization
- Misc
- Rich/HTML Textboxes
- Troubleshooting
- RapidSpell Web Java
- SearchUnit
- Version 2 Articles
- Version 3 Articles
- Thesaurus Desktop .NET
How do I use RapidSpellAsYouType and Thesaurus context menus together?
https://keyoti.com/kb/Default.aspx?ToDo=view&questId=69&catId=63
Options
Print this page
Email this to a friend
1. Set ShowSuggestionsContextMenu to false in RapidSpellAsYouType
2. Add a context menu to the text box
3. Create a MenuItem in the context menu called SynonymsMenuItem, and make it's Text
"Synonyms"
4. Add the following event handler to the form
Private Sub cm_popup(ByVal sender As Object, ByVal e As System.EventArgs) Handles
ContextMenu1.Popup
Dim spellingSuggestions = Me.RapidSpellAsYouType1.GetSuggestions()
Me.ContextMenu1.MenuItems.Clear()
'If there are spelling suggestions, show them
If Not spellingSuggestions Is Nothing Then
Me.ContextMenu1.MenuItems.AddRange(spellingSuggestions)
Else
'Show thesaurus sub menu
Me.ContextMenu1.MenuItems.Add(Me.SynonymsMenuItem)
Dim suggestions As MenuItem() = Me.Thesaurus1.GetSuggestionMenuItems()
Dim noSuggestionsMenuItem As New MenuItem("(No suggestions)")
noSuggestionsMenuItem.Enabled = False
Me.SynonymsMenuItem.MenuItems.Clear()
If Not (suggestions Is Nothing) Then
Me.SynonymsMenuItem.MenuItems.AddRange(suggestions)
Else
Me.SynonymsMenuItem.MenuItems.Add(noSuggestionsMenuItem)
End If
End If
End Sub 'cm_popup
This code assumes that; your ContextMenu is called "ContextMenu1", your synonyms
menu item is called "SynonymsMenuItem", your RapidSpellAsYouType is called
"RapidSpellAsYouType1" and your Thesaurus is called "Thesaurus1"
This will show the spelling suggestions menu when right clicking on a misspelt word,
and the thesaurus submenu when not. You can of course customize this as you wish,
to include your own items, however you will need to re-add them to ContextMenu1
everytime the method is called.
Related Questions:
With RapidSpellAsYouType, how can I use the spell checker suggestions menu items with my own context menu?
How can I disable the Change / Change All buttons programmatically? (C#)
How can I change the position of the as-you-type context menu? (C#)
Attachments:
No attachments were found.