'Declaration Public Event TableOfContentsAfterSelect As TreeViewEventHandler
public event TreeViewEventHandler TableOfContentsAfterSelect
Event Data
The event handler receives an argument of type TreeViewEventArgs containing data related to this event. The following TreeViewEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Action | Gets the type of action that raised the event. |
Node | Gets the tree node that has been checked, expanded, collapsed, or selected. |
Remarks
The System.Windows.Forms.TreeViewEventArgs provides information about the selected item, enabling event handlers to access the item's properties and take appropriate actions, such as navigating to the corresponding section in the document.
Example
// Assuming 'viewer' is an instance of the Viewer class // Subscribe to the TableOfContentsAfterSelect event viewer.TableOfContentsAfterSelect += Viewer_TableOfContentsAfterSelect; // Event handler for TableOfContentsAfterSelect private void Viewer_TableOfContentsAfterSelect(object sender, TreeViewEventArgs e) { var selectedNodeText = e.Node.Text; MessageBox.Show($"You have selected: {selectedNodeText}", "TOC Selection"); }
See Also