This can be acheived by setting; Me .RapidSpellAsYouType1.ShowSuggestionsContextMenu = Falseand listening to the popup event of your own context menu to dynamically add your own items; Private Sub ContextMenu1_Popup(ByVal sender As Object, ByVal e As System.EventArgs) Handles ContextMenu1.PopupContextMenu1.MenuItems.Clear() ContextMenu1.MenuItems.Add("Item1") ContextMenu1.MenuItems.Add("Item2") End Suband also listening to the SpellContextMenuRequest event to add your items and the RapidSpellAsYouType suggestions and other menu items; Private Sub RapidSpellAsYouType1_SpellContextMenuRequest(ByVal sender As Object, ByVal e As Keyoti.RapidSpell.Event.SpellContextMenuEventArgs) Handles RapidSpellAsYouType1.SpellContextMenuRequestMe.AytRichTextBox1.ContextMenu.MenuItems.Clear()'All all suggestions items etc. Me.AytRichTextBox1.ContextMenu.MenuItems.AddRange(DirectCast(e.MenuItems, MenuItem()))'Add own menu items ContextMenu1.MenuItems.Add("Item1") ContextMenu1.MenuItems.Add("Item2") End Sub Because the menu items supplied in e.MenuItems are already hooked into the RapidSpellAsYouType object, no extra programming is needed. VB code example Public Class Form5Inherits System.Windows.Forms.Form# Region " Windows Form Designer generated code "Public Sub New()MyBase.New()'This call is required by the Windows Form Designer.InitializeComponent() 'Add any initialization after the InitializeComponent() callEnd Sub'Form overrides dispose to clean up the component list.Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)If disposing ThenIf Not (components Is Nothing) Thencomponents.Dispose() End IfEnd IfMyBase.Dispose(disposing)End Sub'Required by the Windows Form DesignerPrivate components As System.ComponentModel.IContainer'NOTE: The following procedure is required by the Windows Form Designer'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor.Friend WithEvents AytRichTextBox1 As Keyoti.RapidSpell.AYTRichTextBoxFriend WithEvents RapidSpellAsYouType1 As Keyoti.RapidSpell.RapidSpellAsYouTypeFriend WithEvents ContextMenu1 As System.Windows.Forms.ContextMenu<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()Me.components = New System.ComponentModel.ContainerMe.AytRichTextBox1 = New Keyoti.RapidSpell.AYTRichTextBoxMe.RapidSpellAsYouType1 = New Keyoti.RapidSpell.RapidSpellAsYouType(Me.components)Me.ContextMenu1 = New System.Windows.Forms.ContextMenuMe.SuspendLayout()''AytRichTextBox1'Me.AytRichTextBox1.ContextMenu = Me.ContextMenu1Me.AytRichTextBox1.Dock = System.Windows.Forms.DockStyle.FillMe.AytRichTextBox1.Location = New System.Drawing.Point(0, 0)Me.AytRichTextBox1.Name = "AytRichTextBox1"Me.AytRichTextBox1.ShowCutCopyPasteContextMenu = FalseMe.AytRichTextBox1.Size = New System.Drawing.Size(292, 271)Me.AytRichTextBox1.TabIndex = 0Me.AytRichTextBox1.Text = "AytRichTextBox1"Me.AytRichTextBox1.UseUndoCompatibleTextAccess = False''RapidSpellAsYouType1'Me.RapidSpellAsYouType1.AddMenuText = "Add"Me.RapidSpellAsYouType1.AllowMixedCase = FalseMe.RapidSpellAsYouType1.CheckAsYouType = TrueMe.RapidSpellAsYouType1.CheckCompoundWords = FalseMe.RapidSpellAsYouType1.ConsiderationRange = 80Me.RapidSpellAsYouType1.DictFilePath = NothingMe.RapidSpellAsYouType1.GUILanguage = Keyoti.RapidSpell.LanguageType.ENGLISHMe.RapidSpellAsYouType1.IgnoreAllMenuText = "Ignore All"Me.RapidSpellAsYouType1.IgnoreCapitalizedWords = FalseMe.RapidSpellAsYouType1.IgnoreURLsAndEmailAddresses = TrueMe.RapidSpellAsYouType1.IgnoreWordsWithDigits = TrueMe.RapidSpellAsYouType1.IncludeUserDictionaryInSuggestions = FalseMe.RapidSpellAsYouType1.LanguageParser = Keyoti.RapidSpell.LanguageType.ENGLISHMe.RapidSpellAsYouType1.LookIntoHyphenatedText = TrueMe.RapidSpellAsYouType1.SeparateHyphenWords = FalseMe.RapidSpellAsYouType1.ShowAddMenuOption = TrueMe.RapidSpellAsYouType1.ShowSuggestionsContextMenu = FalseMe.RapidSpellAsYouType1.SuggestionsMethod = Keyoti.RapidSpell.SuggestionsMethodType.HashingSuggestionsMe.RapidSpellAsYouType1.SuggestSplitWords = TrueMe.RapidSpellAsYouType1.TextComponent = Me.AytRichTextBox1Me.RapidSpellAsYouType1.UnderlineColor = System.Drawing.Color.RedMe.RapidSpellAsYouType1.UnderlineStyle = Keyoti.RapidSpell.UnderlineStyle.WavyMe.RapidSpellAsYouType1.UserDictionaryFile = NothingMe.RapidSpellAsYouType1.V2Parser = True''ContextMenu1'''Form5'Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)Me.ClientSize = New System.Drawing.Size(292, 271)Me.Controls.Add(Me.AytRichTextBox1)Me.Name = "Form5"Me.Text = "Form5"Me.ResumeLayout(False)End Sub# End RegionPrivate Sub ContextMenu1_Popup(ByVal sender As Object, ByVal e As System.EventArgs) Handles ContextMenu1.PopupContextMenu1.MenuItems.Clear() ContextMenu1.MenuItems.Add("Item1") ContextMenu1.MenuItems.Add("Item2") End SubPrivate Sub RapidSpellAsYouType1_SpellContextMenuRequest(ByVal sender As Object, ByVal e As Keyoti.RapidSpell.Event.SpellContextMenuEventArgs) Handles RapidSpellAsYouType1.SpellContextMenuRequestMe.AytRichTextBox1.ContextMenu.MenuItems.Clear()Me.AytRichTextBox1.ContextMenu.MenuItems.AddRange(DirectCast(e.MenuItems, MenuItem()))ContextMenu1.MenuItems.Add("Item1") ContextMenu1.MenuItems.Add("Item2") End SubEnd Class |