So I’ve tried googling this but it hasn’t come back with anything useful or at least not anything that would help with this particular scenario.
Essentially what I would like to do is have a word in a richtexbox which is linked to a line elsewhere in the same richtextbox so that when a user clicks the word they are taken to the associated line.
I’ve considered storing an array of every linked word with its index and length that gets searched each time the user navigates the textbox and scrolls to the linked line number when selected but this doesn’t seem very efficient.
I’m afraid that the richtextbox doesn’t support anything like that out of the box, so your suggestion is actually a good way to go. To improve performance, you can use a dictionary to look up the selected link. The performance hit shouldn’t be noticeable.