Posted 17 years ago by ernesto
Avatar
How can I move the caret and view of the Editor to the position of text that I select from a ListBox.
I would like to search the Editor for the selected text and scroll its position to the top of the editor to bring it into view.

thanks
teamels

Comments (2)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The editor.SelectedView.Selection object is what is used to control the selection. The caret's location is always at the end offset of the selection. editor.SelectedView.FindReplace lets you get to the find/replace object model which will highlight found text. There are numerous properties on the EditorView class that provide for changing which lines are displayed. Hope that helps.


Actipro Software Support

Posted 17 years ago by ernesto
Avatar
Yes, this works great!

        Dim resultset As FindReplaceResultSet
        Dim options As New FindReplaceOptions
        options.FindText = ListBox1.SelectedItem.ToString
        resultset = EditControl1.SelectedView.FindReplace.Find(options)
Note for reference: "EditControl1 is my reference to SyntaxEditor"

thanks
teamels

[Modified at 01/30/2007 12:44 PM]
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.