I have a Find Previous/Next feature that highlights the found text in a DesktopTextArea. My problem is that it doesn’t bring the newly highlighted text into view.
I have tried the following but, while it moves the view, displays the wrong location on the line. Anyone got a hint?
I find the character position of a TextArea in the MouseDown event with “TextArea.CharacterPosition(x,y)”. Then, after modifying some text at that Character pos and rewriting the modified text into the TextArea, I attempt to scroll back to that original character position using LineNumber(charPos), but instead the vertical scroll position goes to the bottom.
gCharPos = TextArea.CharacterPosition(x,y)
. . . (do some work; update TextArea text)
TextArea.VerticalScrollPosition = TextArea.LineNumber(gCharPos)
… always scrolls to bottom, regardless of where gCharPos is located.