Back to Devexpress

HyperlinkClickEventArgs.Text Property

windowsforms-devexpress-dot-utils-dot-hyperlinkclickeventargs-5c6491d5.md

latest3.6 KB
Original Source

HyperlinkClickEventArgs.Text Property

Gets or sets the hyperlink alt text. Note that modifying this text does not change the item caption.

Namespace : DevExpress.Utils

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
public string Text { get; set; }
vb
Public Property Text As String

Property Value

TypeDescription
String

The hyperlink alt text.

|

Remarks

The sample below illustrates the difference between HyperlinkClickEventArgs.Text and BarItem.Caption properties.

csharp
counter = 0;
barStaticItem1.Caption = "<a href=fakeurl>Click to increase the counter (Current value: "
    + counter.ToString() + ")";

void OnHyperlinkClick(object sender, HyperlinkClickEventArgs e) {
    if (e.Link == "fakeurl") {
        counter++;
        e.Text = "Click to increase the counter(Current value: " + counter.ToString() + ")";
        barStaticItem1.Hint = "e.Text value: '" + e.Text + "'" ;
    }
}
vb
counter = 0
barStaticItem1.Caption = "<a href=fakeurl>Click to increase the counter (Current value: " & counter.ToString() & ")"

Private Sub OnHyperlinkClick(ByVal sender As Object, ByVal e As HyperlinkClickEventArgs)
    If e.Link = "fakeurl" Then
        counter += 1
        e.Text = "Click to increase the counter(Current value: " & counter.ToString() & ")"
        barStaticItem1.Hint = "e.Text value: '" & e.Text & "'"
    End If
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Text property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

create-winforms-accordion-control-in-code/CS/AccordionControl-ex/Form1.cs#L126

csharp
private void hyperlinkLabelControl1_HyperlinkClick(object sender, DevExpress.Utils.HyperlinkClickEventArgs e) {
    Process.Start(e.Text);
}

create-winforms-accordion-control-in-code/VB/AccordionControl-ex/Form1.vb#L116

vb
Private Sub hyperlinkLabelControl1_HyperlinkClick(ByVal sender As Object, ByVal e As DevExpress.Utils.HyperlinkClickEventArgs)
    Call Process.Start(e.Text)
End Sub

See Also

HyperlinkClickEventArgs Class

HyperlinkClickEventArgs Members

DevExpress.Utils Namespace