Syncronizing TreeView nodes and RichTextBox [modified]
-
I am looking for a suggestion, or an example, on how to sync the text in a TreeView to text in a RichTextBox. My treeview is an outline of sorts and I want to allow the user to click a node and then hightlight all occurrences of the text in a RichTexBox. I thought of using a Hashtable or Dictionary to index the outline, however, there are occasions when there are multiple keys with throws an exception. I guess the best example is the help documentation in the Visual Studio .NET. Thanks, Mark
modified on Sunday, April 6, 2008 3:19 PM
-
I am looking for a suggestion, or an example, on how to sync the text in a TreeView to text in a RichTextBox. My treeview is an outline of sorts and I want to allow the user to click a node and then hightlight all occurrences of the text in a RichTexBox. I thought of using a Hashtable or Dictionary to index the outline, however, there are occasions when there are multiple keys with throws an exception. I guess the best example is the help documentation in the Visual Studio .NET. Thanks, Mark
modified on Sunday, April 6, 2008 3:19 PM
Hi, FYI: a TreeNode has a Tag property where you can store something, say a List of things you want to be able to refer to later on. :)
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.