I'm trying to make a help file in Visual Basic. I've decided to go the route of replicating the old style help files with a TreeView
panel, to the left, and a RichTextbox
, on the right, of the form. (This set-up looks like the help file in PowerShell almost exactly.
I'm trying to make it so that when a TreeView
Node
is Single Clicked
the RichTextbox
Text
will change to the appropriate text. Here is my code:
Private Sub treeView_NodeMouseClick(ByVal sender As Object, ByVal e As TreeNodeMouseClickEventArgs) Handles TreeViewContents.NodeMouseClick
If e.Node.Text.Equals("Program Help") Then
RTBHelp.Text = Environment.NewLine & "Help text here."
End If
If e.Node.Text.Equals("Program Getting Started") Then
RTBHelp.Text = Environment.NewLine & "Getting Started text here"
End If
End Sub
The problem is that the text will change when simply clicking the Plus
or Minus
located next to the TreeView
Node
. But, I want to emulate the PowerShell help behavior, where clicking the Plus
or Minus
expands or collapses the nodes but does not change the RichTextbox
Text
. Only when clicking on the Nodes
name (Text
) itself should the RichTextbox
Text
change. I have tried several methods but none seem to work. What do I do?