Back to Devexpress

RibbonControl.HyperlinkClick Event

windowsforms-devexpress-dot-xtrabars-dot-ribbon-dot-ribboncontrol-cd76b8c9.md

latest3.7 KB
Original Source

RibbonControl.HyperlinkClick Event

Occurs when a hyperlink within the current RibbonControl is clicked.

Namespace : DevExpress.XtraBars.Ribbon

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Action")]
public event HyperlinkClickEventHandler HyperlinkClick
vb
<DXCategory("Action")>
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

BarItems, displayed within a RibbonControl, can display hyperlinks within their BarItem.Captions and/or BarItem.Descriptions. Set the RibbonControl.AllowHtmlText property to true and format the desired string via the <href></href> tag. Refer to the HTML Text Formatting topic to learn more.

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 override the global RibbonControl.AllowHtmlText property setting for individual items. To do so, use the BarItem.AllowHtmlText property.

See Also

RibbonControl.AllowHtmlText

BarItem.AllowHtmlText

HTML-inspired Text Formatting

RibbonControl Class

RibbonControl Members

DevExpress.XtraBars.Ribbon Namespace