Back to Devexpress

SpellChecker.PrepareContextMenu Event

windowsforms-devexpress-dot-xtraspellchecker-dot-spellchecker-aa68cadb.md

latest2.8 KB
Original Source

SpellChecker.PrepareContextMenu Event

OBSOLETE

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

Declaration

csharp
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("You should use the 'PopupMenuShowing' instead", true)]
public event PrepareContextMenuEventHandler PrepareContextMenu
vb
<Browsable(False)>
<EditorBrowsable(EditorBrowsableState.Never)>
<Obsolete("You should use the 'PopupMenuShowing' instead", True)>
Public Event PrepareContextMenu As PrepareContextMenuEventHandler

Event Data

The PrepareContextMenu event's data class is DevExpress.XtraSpellChecker.PrepareContextMenuEventArgs.

Remarks

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.

csharp
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;
}
vb
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

How to: Obtain a List of Commands for the Misspelled Word

SpellChecker Class

SpellChecker Members

DevExpress.XtraSpellChecker Namespace