Back to Devexpress

NavBarItemLink.Caption Property

windowsforms-devexpress-dot-xtranavbar-dot-navbaritemlink-05a0f096.md

latest2.9 KB
Original Source

NavBarItemLink.Caption Property

Gets the link’s caption.

Namespace : DevExpress.XtraNavBar

Assembly : DevExpress.XtraNavBar.v25.2.dll

NuGet Package : DevExpress.Win

Declaration

csharp
[SearchColumn]
public string Caption { get; }
vb
<SearchColumn>
Public ReadOnly Property Caption As String

Property Value

TypeDescription
String

A string value representing the link’s caption.

|

Remarks

This property reads the NavElement.Caption property of the corresponding NavBarItem object to return its value. This object is obtained via the NavBarItemLink.Item property.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Caption 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-navbar-control-in-code/CS/CreateNavBar/Form1.cs#L97

csharp
void navBar_SelectedLinkChanged(object sender, DevExpress.XtraNavBar.ViewInfo.NavBarSelectedLinkChangedEventArgs e) {
    string s = string.Format("'{0}' selected", e.Link.Caption);
    listBoxControl1.Items.Add(s);

create-navbar-control-in-code/VB/CreateNavBar/Form1.vb#L85

vb
Private Sub navBar_SelectedLinkChanged(ByVal sender As Object, ByVal e As ViewInfo.NavBarSelectedLinkChangedEventArgs)
    Dim s As String = String.Format("'{0}' selected", e.Link.Caption)
    listBoxControl1.Items.Add(s)

See Also

Caption

NavBarItem

NavBarItemLink Class

NavBarItemLink Members

DevExpress.XtraNavBar Namespace