Back to Devexpress

BarManager.HyperlinkClick Event

windowsforms-devexpress-dot-xtrabars-dot-barmanager-ace3923f.md

latest3.5 KB
Original Source

BarManager.HyperlinkClick Event

Occurs each time an end-user clicks a hyperlink within the BarManager control.

Namespace : DevExpress.XtraBars

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Click")]
public event HyperlinkClickEventHandler HyperlinkClick
vb
<DXCategory("Click")>
Public Event HyperlinkClick As HyperlinkClickEventHandler

Event Data

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

PropertyDescription
LinkGet or sets the URL of the clicked hyperlink.
MouseArgsGets or sets mouse coordinates calculated from the toolbar’s upper left corner.
TextGets or sets the hyperlink alt text. Note that modifying this text does not change the item caption.

Remarks

You can place a hyperlink within a BarStaticItem or a BarButtonItem. To do so, allow text formatting via HTML tags (set the BarManager.AllowHtmlText property to true ) and use the <href></href> tag for the item’s caption.

csharp
public Form1() {
    InitializeComponent();
    barManager1.AllowHtmlText = true;
    barStaticItem1.Caption = "Visit our <href=www.devexpress.com>Web-site</href>";
}

private void barManager1_HyperlinkClick(object sender, DevExpress.Utils.HyperlinkClickEventArgs e) {
    System.Diagnostics.Process.Start(e.Link);
}
vb
Public Sub Form1()
    InitializeComponent()
    barManager1.AllowHtmlText = True
    barStaticItem1.Caption = "Visit our <href=www.devexpress.com>Web-site</href>"
End Sub

Private Sub barManager1_HyperlinkClick(ByVal sender As Object, ByVal e As DevExpress.Utils.HyperlinkClickEventArgs)
    System.Diagnostics.Process.Start(e.Link)
End Sub

See the HTML Text Formatting topic for the list of all available HTML tags.

You can also handle the BarItem.HyperlinkClick event for individual bar items.

Clicking HyperLinkEdit items does not fire the HyperlinkClick event.

See Also

HyperlinkClick

AllowHtmlText

HTML-inspired Text Formatting

BarManager Class

BarManager Members

DevExpress.XtraBars Namespace