General Information
.NET Subscription
Desktop
Web
Controls and Extensions
Mainteinance Mode
Enterprise and Analytic Tools
Quality Assurance and Productivity
Frameworks and Libraries
All docs
V19.2
General Information
.NET Subscription
Desktop
Web
Controls and Extensions
Mainteinance Mode
Enterprise and Analytic Tools
Quality Assurance and Productivity
Frameworks and Libraries
19.2
19.1
18.2
18.1
17.2
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.
.NET Core 3.0+
ShowFormEventArgs.DialogResult Property
Gets or sets the return value of a dialog box.
Namespace: DevExpress.XtraRichEdit
Assembly: DevExpress.RichEdit.v19.2.Core.dll
Declaration
Property Value
Type | Description |
---|---|
DialogResult | A DialogResult enumeration value that specifies the value that is returned by the dialog box. |
Property Value
Type | Description |
---|---|
DialogResult | A DialogResult enumeration value that specifies the value that is returned by the dialog box. |
Remarks
Use the DialogResult property with the ShowFormEventArgs.Handled parameter set to true, to change the return value of the dialog box.
Examples
This example demonstrates how to replace the standard Find and Replace dialog with a custom one via the RichEditControl.SearchFormShowing event.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-customize-dialog-forms-in-xtrarichedit-suite-e3095
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;
}
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;
}
}
}
Imports Microsoft.VisualBasic
Imports System.Drawing
Imports DevExpress.XtraRichEdit.Forms
Namespace CustomDialogs
Partial Public Class MySearchTextForm
Inherits SearchTextForm
Public Sub New(ByVal controllerParameters As SearchFormControllerParameters, ByVal searchWord As String)
MyBase.New(controllerParameters)
lblFndDirection.Location = New Point (lblFndDirection.Location.X - 10, lblFndDirection.Location.Y)
lblFndDirection.Text = "Direction:"
cbFndSearchString.Text = searchWord
chbFndRegex.Enabled = False
End Sub
End Class
End Namespace
Private Sub richEditControl1_SearchFormShowing(ByVal sender As Object, ByVal e As SearchFormShowingEventArgs) Handles richEditControl1.SearchFormShowing
Dim curWord As String = richEditControl1.Document.GetText(richEditControl1.Document.Selection)
Dim form As New MySearchTextForm(e.ControllerParameters, curWord)
e.DialogResult = form.ShowDialog()
e.Handled = True
End Sub
See Also
Feedback