Skip to main content

DevExpress v24.1 Update — Your Feedback Matters

Our What's New in v24.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ShowFormEventArgs Class

Serves as the base for classes which provide data for the events which occur before the RichEditControl dialogs are shown.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v24.1.dll

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

#Declaration

public class ShowFormEventArgs :
    EventArgs

#Remarks

Events which use the ShowFormEventArgs class descendants occur before different RichEditControl dialogs are invoked. The ShowFormEventArgs class introduces the ShowFormEventArgs.DialogResult property, that specifies the return value of a dialog, the ShowFormEventArgs.Handled property that specifies whether an event was handled and the ShowFormEventArgs.Parent property that specifies a parent of the form being shown.

#Example

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