ContextButtonBase.HyperlinkClick Event

Fires when a hyperlink in the button caption is clicked.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v20.1.dll


public event HyperlinkClickEventHandler HyperlinkClick
Public Event HyperlinkClick As HyperlinkClickEventHandler

Event Data

The HyperlinkClick event's data class is DevExpress.Utils.HyperlinkClickEventArgs.


If the HTML formatting feature is enabled (see ContextButtonBase.AllowHtmlText), you can display a hyperlink in the button caption (see ContextButtonBase.Caption) using the href tag. The ContextButtonBase.HyperLinkColor property allows you to specify the color of the hyperlink text.

If the caption contains a hyperlink, handle the HyperlinkClick event to respond to a click on the hyperlink. The Link property of event arguments returns the hyperlink being clicked. The Text property returns the hyperlink text. The code snippet below shows how the HyperlinkClick event can be handled (it is assumed that the context button is displayed in the PictureEdit control).

using DevExpress.Utils;

ContextButton link = new ContextButton();
link.Caption = "<>Our web site</href>";
link.AllowHtmlText = DefaultBoolean.True;
link.HyperlinkClick += link_HyperlinkClick;
link.HyperLinkColor = Color.Fuchsia;
link.AlignmentOptions.Panel = ContextItemPanel.Bottom;
link.AlignmentOptions.Position = ContextItemPosition.Far;

void link_HyperlinkClick(object sender, HyperlinkClickEventArgs e) {
    Process.Start("IEXPLORE.EXE", e.Link);

After the HyperlinkClick event is fired, the ContextItem.Click event fires.

See Also