Skip to main content

ShowFormEventArgs.DialogResult Property

Gets or sets the return value of a dialog box.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v24.1.dll

NuGet Packages: DevExpress.Win.PivotGrid, DevExpress.Win.RichEdit, DevExpress.Win.TreeMap


public DialogResult DialogResult { get; set; }

Property Value

Type Description

A DialogResult enumeration value that specifies the value that is returned by the dialog box.


Use the DialogResult property with the ShowFormEventArgs.Handled parameter set to true, to change the return value of the dialog box.


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

private void richEditControl1_SearchFormShowing(object sender, SearchFormShowingEventArgs e)
    string curWord = richEditControl.Document.GetText(richEditControl.Document.Selection);
    using (MySearchTextForm form = new MySearchTextForm(e.ControllerParameters, curWord))
        e.DialogResult = form.ShowDialog();
        e.Handled = true;
using System.Drawing;
using DevExpress.XtraRichEdit.Forms;

namespace CustomDialogs
    public partial class MySearchTextForm : SearchTextForm
        public MySearchTextForm(SearchFormControllerParameters controllerParameters, string searchWord)
            : base(controllerParameters)
            lblFndDirection.Location = new Point (lblFndDirection.Location.X - 10, lblFndDirection.Location.Y);
            lblFndDirection.Text = "Direction:";
            cbFndSearchString.Text = searchWord;
            chbFndRegex.Enabled = false;
See Also