Skip to main content

HyperlinkFormShowingEventArgs Class

Provides data for the RichEditControl.HyperlinkFormShowing event.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v22.1.dll

NuGet Package: DevExpress.Win.RichEdit

Declaration

public class HyperlinkFormShowingEventArgs :
    FormShowingEventArgs

Remarks

The RichEditControl.HyperlinkFormShowing event occurs before the Edit Hyperlink dialog is invoked. The HyperlinkFormShowingEventArgs class introduces the HyperlinkFormShowingEventArgs.ControllerParameters property, that specifies the information to be displayed in the dialog.

Note, that HyperlinkFormShowingEventArgs objects are automatically created, initialized and passed to the RichEditControl.HyperlinkFormShowing event handlers.

Example

This example demonstrates how to replace the standard Hyperlink dialog with a custom form using the RichEditControl.HyperlinkFormShowing event.

View Example

private void richEditControl1_HyperlinkFormShowing(object sender,HyperlinkFormShowingEventArgs e)
{
    MyHyperlinkForm form = new MyHyperlinkForm(e.ControllerParameters);
    e.DialogResult = form.ShowDialog();
    form.Dispose();
    e.Handled = true;
}
using System;
using DevExpress.XtraRichEdit.Forms;

namespace CustomDialogs {
    class MyHyperlinkForm : HyperlinkForm {
        public MyHyperlinkForm(HyperlinkFormControllerParameters controllerParameters)
            : base(controllerParameters)
        {
            btnEditAddress.EditValueChanged += new EventHandler(btnEditAddress_EditValueChanged);
            btnEditAddress.LostFocus += new EventHandler(btnEditAddress_LostFocus);
        }

        void btnEditAddress_LostFocus(object sender, EventArgs e) {
            this.btnEditAddress.Text = Controller.NavigateUri;
        }

        void btnEditAddress_EditValueChanged(object sender, EventArgs e) {
            Controller.NavigateUri = ValidateUrl(btnEditAddress.Text);
            this.btnOk.Enabled = true;
        }

        private string ValidateUrl(string p) {
            string s = p.Replace("devexpres.com", "devexpress.com");
            return s;
        }

    }
}

Inheritance

See Also