windowsforms-devexpress-dot-xtranavbar-dot-navbaritemlink-05a0f096.md
Gets the link’s caption.
Namespace : DevExpress.XtraNavBar
Assembly : DevExpress.XtraNavBar.v25.2.dll
NuGet Package : DevExpress.Win
[SearchColumn]
public string Caption { get; }
<SearchColumn>
Public ReadOnly Property Caption As String
| Type | Description |
|---|---|
| String |
A string value representing the link’s caption.
|
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
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
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