Back to Devexpress

RichEditControl.HyphenationFormShowing Event

windowsforms-devexpress-dot-xtrarichedit-dot-richeditcontrol-614ac185.md

latest4.3 KB
Original Source

RichEditControl.HyphenationFormShowing Event

Occurs before the Hyphenation dialog is invoked.

Namespace : DevExpress.XtraRichEdit

Assembly : DevExpress.XtraRichEdit.v25.2.dll

NuGet Package : DevExpress.Win.RichEdit

Declaration

csharp
public event HyphenationFormShowingEventHandler HyphenationFormShowing
vb
Public Event HyphenationFormShowing As HyphenationFormShowingEventHandler

Event Data

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

PropertyDescription
DialogResultGets or sets the return value of a dialog box. Inherited from ShowFormEventArgs.
HandledGets or sets whether an event was handled. If it was handled, the default actions are not required. Inherited from ShowFormEventArgs.
HyphenationInfoProvides access to the hyphenation information.
ParentGets or sets a parent of the form being shown. Inherited from ShowFormEventArgs.

Remarks

Handle the HyphenationFormShowing event to perform any actions prior to the Hyphenation dialog being shown. For example, you can substitute the standard dialog with a custom one and set the ShowFormEventArgs.Handled property to true , to prevent default event handling.

The code sample below shows how to handle the HyphenationFormShowing event to change the caption of the Hyphenation dialog.

csharp
class MyHyphenationForm : HyphenationOptionsForm
{
    public MyHyphenationForm(IRichEditControl control, HyphenationInfo hyphenationInfo) : base(control, hyphenationInfo)
    {
        this.Text = "Change Hyphenation Options";
    }
}

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
        this.richEditControl.HyphenationFormShowing += RichEditControl_HyphenationFormShowing;
    }

    private void RichEditControl_HyphenationFormShowing(object sender, HyphenationFormShowingEventArgs e)
    {
        MyHyphenationForm frm = new MyHyphenationForm(this.richEditControl, e.HyphenationInfo);
        e.DialogResult = frm.ShowDialog();
        frm.Dispose();
        e.Handled = true;

    }
}
vb
Class MyHyphenationForm
    Inherits HyphenationOptionsForm

    Public Sub New(ByVal control As IRichEditControl, ByVal hyphenationInfo As HyphenationInfo)
        MyBase.New(control, hyphenationInfo)
        Me.Text = "Change Hyphenation Options"
    End Sub
End Class

Public Partial Class Form1
    Inherits Form

    Public Sub New()
        InitializeComponent()
        Me.richEditControl.HyphenationFormShowing += AddressOf RichEditControl_HyphenationFormShowing
    End Sub

    Private Sub RichEditControl_HyphenationFormShowing(ByVal sender As Object, ByVal e As HyphenationFormShowingEventArgs)
        Dim frm As MyHyphenationForm = New MyHyphenationForm(Me.richEditControl, e.HyphenationInfo)
        e.DialogResult = frm.ShowDialog()
        frm.Dispose()
        e.Handled = True
    End Sub
End Class

See Also

RichEditControl Class

RichEditControl Members

DevExpress.XtraRichEdit Namespace