Back to Devexpress

BarItem.HyperlinkClick Event

windowsforms-devexpress-dot-xtrabars-dot-baritem-a764a3c7.md

latest3.3 KB
Original Source

BarItem.HyperlinkClick Event

Occurs each time an end-user clicks a hyperlink within the current BarItem.

Namespace : DevExpress.XtraBars

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public event HyperlinkClickEventHandler HyperlinkClick
vb
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 tag for the item’s caption. Refer to the HTML Text Formatting topic to see all available HTML tags.

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

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

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

You can also handle the BarManager.HyperlinkClick event to handle any hyperlink click within the entire BarManager control.

See Also

AllowHtmlText

HyperlinkClick

HTML-inspired Text Formatting

BarItem Class

BarItem Members

DevExpress.XtraBars Namespace