windowsforms-devexpress-dot-xtraspellchecker-dot-spellchecker-aa68cadb.md
You should use the 'PopupMenuShowing' instead
Occurs before a context menu is created.
Namespace : DevExpress.XtraSpellChecker
Assembly : DevExpress.XtraSpellChecker.v25.2.dll
NuGet Package : DevExpress.Win.SpellChecker
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("You should use the 'PopupMenuShowing' instead", true)]
public event PrepareContextMenuEventHandler PrepareContextMenu
<Browsable(False)>
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("You should use the 'PopupMenuShowing' instead", True)>
Public Event PrepareContextMenu As PrepareContextMenuEventHandler
The PrepareContextMenu event's data class is DevExpress.XtraSpellChecker.PrepareContextMenuEventArgs.
Handle this event to add new menu items to the context menu, or to modify existing items. The following code snippet illustrates how to use this event to add a “Clear All” menu item that deletes all text in the text editor.
spellChecker1.PrepareContextMenu +=
new PrepareContextMenuEventHandler(spellChecker1_PrepareContextMenu);
void spellChecker1_PrepareContextMenu(object sender, PrepareContextMenuEventArgs e) {
e.Menu.Items.Add(new DXMenuItem("Clear All", OnClearMenuItemClick));
}
void OnClearMenuItemClick(object sender, EventArgs e) {
this.textEdit1.Text = String.Empty;
}
Private spellChecker1.PrepareContextMenu += _
New PrepareContextMenuEventHandler(spellChecker1_PrepareContextMenu)
Private Sub spellChecker1_PrepareContextMenu(ByVal sender As Object, _
ByVal e As PrepareContextMenuEventArgs)
e.Menu.Items.Add(New DXMenuItem("Clear All", AddressOf OnClearMenuItemClick))
End Sub
Private Sub OnClearMenuItemClick(ByVal sender As Object, ByVal e As EventArgs)
Me.textEdit1.Text = String.Empty
End Sub
See Also