Back to Devexpress

ShowFormEventArgs Class

windowsforms-devexpress-dot-xtrarichedit-d2f04952.md

latest7.7 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Win.RichEdit

Declaration

csharp
public class ShowFormEventArgs :
    EventArgs
vb
Public Class ShowFormEventArgs
    Inherits 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.

csharp
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;
    }
}
vb
Private Sub richEditControl1_SearchFormShowing(ByVal sender As Object, ByVal e As SearchFormShowingEventArgs)
Dim curWord As String = richEditControl.Document.GetText(richEditControl.Document.Selection)
Using form As New MySearchTextForm(e.ControllerParameters, curWord)
    e.DialogResult = form.ShowDialog()
    e.Handled = True
End Using
End Sub
csharp
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;
        }
    }
}
vb
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

Inheritance

Show 35 items

Object EventArgs ShowFormEventArgs EncryptDocumentFormShowingEventArgs

FormShowingEventArgs

HyphenationFormShowingEventArgs

DeleteTableCellsFormShowingEventArgs

DocumentPropertiesFormShowingEventArgs

DocumentProtectionQueryNewPasswordFormShowingEventArgs

NumberingListFormShowingEventArgs

PageSetupFormShowingEventArgs

FontFormShowingEventArgs

HyperlinkFormShowingEventArgs

InsertMergeFieldFormShowingEventArgs

InsertTableCellsFormShowingEventArgs

WatermarkFormShowingEventArgs

BookmarkFormShowingEventArgs

ColumnsSetupFormShowingEventArgs

ConvertNotesFormShowingEventArgs

ParagraphFormShowingEventArgs

PasteSpecialFormShowingEventArgs

RangeEditingPermissionsFormShowingEventArgs

SearchFormShowingEventArgs

SplitTableCellsFormShowingEventArgs

SymbolFormShowingEventArgs

DocumentProtectionQueryPasswordFormShowingEventArgs

EditStyleFormShowingEventArgs

FloatingInlineObjectLayoutOptionsFormShowingEventArgs

InsertTableFormShowingEventArgs

LineNumberingFormShowingEventArgs

NotesFormShowingEventArgs

TableOptionsFormShowingEventArgs

TablePropertiesFormShowingEventArgs

TableStyleFormShowingEventArgs

TabsFormShowingEventArgs

See Also

ShowFormEventArgs Members

DevExpress.XtraRichEdit Namespace