Back to Devexpress

LayoutControl.HyperlinkClick Event

windowsforms-devexpress-dot-xtralayout-dot-layoutcontrol.md

latest3.8 KB
Original Source

LayoutControl.HyperlinkClick Event

Occurs each time a user clicks hyperlinks within captions of layout items and layout groups.

Namespace : DevExpress.XtraLayout

Assembly : DevExpress.XtraLayout.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Action")]
public event EventHandler<LayoutItemHyperlinkClickEventArgs> HyperlinkClick
vb
<DXCategory("Action")>
Public Event HyperlinkClick As EventHandler(Of LayoutItemHyperlinkClickEventArgs)

Event Data

The HyperlinkClick event's data class is DevExpress.XtraLayout.LayoutItemHyperlinkClickEventArgs.

Remarks

If you add a hyperlink to the text of a layout item or layout group, you can then handle the HyperlinkClick event to perform actions when a user clicks this hyperlink.

You can add a hyperlink to a layout item’s caption as follows:

To add a hyperlink to a layout group’s caption, do the following:

Note

The HyperlinkClick event does not fire when a user clicks hyperlinks displayed within a tabbed group’s tabs.

Example

The following example adds a hyperlink to a layout item’s caption and launches this link when a user clicks it.

csharp
layoutControlItem1.AllowHtmlStringInCaption = true;
layoutControlItem1.Text = "Leave feedback <href=www.devexpress.com>(learn more)</href>";
//...
private void layoutControl1_HyperlinkClick(object sender, DevExpress.XtraLayout.LayoutItemHyperlinkClickEventArgs e) {
    System.Diagnostics.Process.Start(e.Link);
}
vb
LayoutControlItem1.AllowHtmlStringInCaption = True
LayoutControlItem1.Text = "Leave feedback <href=www.devexpress.com>(learn more)</href>"
'...
Private Sub LayoutControl1_HyperlinkClick(sender As Object, e As DevExpress.XtraLayout.LayoutItemHyperlinkClickEventArgs) Handles LayoutControl1.HyperlinkClick
    System.Diagnostics.Process.Start(e.Link)
End Sub

See Also

HTML-inspired Text Formatting

AllowHtmlStringInCaption

AllowHtmlStringInCaption

LayoutControl Class

LayoutControl Members

DevExpress.XtraLayout Namespace