NodeLink

NodeLink allows you to display a hyperlink. To respond to the link click, subscribe to the LinkClicked treeview event.

Example

// Create the node control.
NodeLink nc = new NodeLink();
nc.AttachTo(tree);

// Add a node with the Link property.
NodeWithLink n = new NodeWithLink("Show features", "www.flexibletreeview.com/features.html");
n.AttachTo(tree);

tree.LinkClicked += tree_LinkClicked;

// Respond to link clicks.
void tree_LinkClicked(FlexibleTreeView treeview, LinkEventArgs args)
{
    MessageBox.Show("Clicked link: " + args.Link);
}
' Create the node control.
Dim nc As New NodeLink()
nc.AttachTo(tree)

' Add a node with the Link property.
Dim n As New NodeWithLink("Show features", "www.flexibletreeview.com/features.html")
n.AttachTo(tree)

AddHandler tree.LinkClicked, AddressOf tree_LinkClicked

' Respond to link clicks.
Private Sub tree_LinkClicked(treeview As FlexibleTreeView, args As LinkEventArgs)
    MessageBox.Show("Clicked link: " & args.Link)
End Sub

You can easily override the hyperlink appearance using these treeview properties:

  • TextStyle.LinkCursor - mouse cursor over hyperlink.
  • TextStyle.LinkStyle — hyperlink visual style.
  • TextStyle.LinkHotStyle - hyperlink under the mouse cursor visual style.

The LinkStyle and LinkHotStyle property values can be combined using any item from the eTextStyle enum.

Also, you can change the hyperlink color in the theme:

Example

// In the global theme for all treeviews.
tree.Theme = eVisualTheme.Global;
ThemeManager.ActiveManager.Colors[eColor.LinkForeColor] = Color.Silver;
ThemeManager.ActiveManager.Colors[eColor.LinkForeColorHot] = Color.Black;

// Or in the separate treeview's personal theme.
tree.Colors[eColor.LinkForeColor] = Color.Silver;
' In the global theme for all treeviews.
tree.Theme = eVisualTheme.Global
ThemeManager.ActiveManager.Colors(eColor.LinkForeColor) = Color.Silver
ThemeManager.ActiveManager.Colors(eColor.LinkForeColorHot) = Color.Black

' Or in the separate treeview's personal theme.
tree.Colors(eColor.LinkForeColor) = Color.Silver