Skip to main content
A newer version of this page is available. .

RichEditControl.SearchFormShowing Event

Occurs when a search form is invoked before it is displayed.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v20.2.dll

NuGet Package: DevExpress.Win.RichEdit

Declaration

public event SearchFormShowingEventHandler SearchFormShowing

Event Data

The SearchFormShowing event's data class is SearchFormShowingEventArgs. The following properties provide information specific to this event:

Property Description
ActivePage Obtains what tab of the Find and Replace dialog (Find or Replace) is active.
ControllerParameters Gets the information for initializing the Find and Replace dialog controls.
DialogResult Gets or sets the return value of a dialog box. Inherited from ShowFormEventArgs.
Handled Gets or sets whether an event was handled. If it was handled, the default actions are not required. Inherited from ShowFormEventArgs.
Parent Gets or sets a parent of the form being shown. Inherited from ShowFormEventArgs.

Remarks

Handle the SearchFormShowing event to perform the required actions before a search form is displayed. Use the SearchFormShowingEventArgs.ActivePage property of the event’s argument to determine what tab is active on the search form - Find or Replace.

Note

The RichEditControl.ShowSearchForm and RichEditControl.ShowReplaceForm methods trigger the SearchFormShowing event.

Example

This example demonstrates how to replace the standard Find and Replace dialog with a custom one via the RichEditControl.SearchFormShowing event.

private void richEditControl1_SearchFormShowing(object sender, SearchFormShowingEventArgs e)
{
    string curWord = richEditControl1.Document.GetText(richEditControl1.Document.Selection);
    MySearchTextForm form = new MySearchTextForm(e.ControllerParameters, curWord);
    e.DialogResult = form.ShowDialog();
    e.Handled = true;
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the SearchFormShowing event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also