programmatically select text range in text area

SyntaxEditor for Windows Forms Forum

Posted 8 years ago by DAVID
Avatar
Hello ,

I am start using text editor and want to know something that i have done in ICSHARP CODE text editor .

I got code like that with ICSHARPCODE TEXT EDITOR

TextLocation start = new TextLocation(int column , int line);
TextLocation end = new TextLocation((int column , int line);
textEditorControl1.ActiveTextAreaControl.SelectionManager.SetSelection(start, end);
textEditorControl1.ActiveTextAreaControl.Caret.Position = end ;

textEditorControl1.ActiveTextAreaControl.ScrollToCaret();
Could you please provide equivalent code in SYNTAX editor.


Another thing is i got intellisene data for php , how to show up completing window and how do i load my own intellisense data for Member List ,Parameter Info ,Quick info. Please refer/provide quick example.

Many thanks

[Modified at 05/23/2011 06:18 PM]

[Modified at 05/23/2011 06:27 PM]

Comments (1)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi David,

In SyntaxEditor you can do something like this to move the caret to a particular line/char:
editor.SelectedView.Selection.StartEditPosition = new EditPosition(line, col);
However that is if your line/char is based on "view" positions. There may be less view lines than document lines when you have collapsed text, etc.

If your line/char are "document" positions then you can do this instead:
editor.SelectedView.Selection.StartOffset = editor.Document.PositionToOffset(new DocumentPosition(line, col));
As for adding IntelliPrompt, you do that in code-behind for the language. So if you are using our sample PHP dynamic language, you'd first need to add a code-behind class for it using the SyntaxLanguageTypeName attribute (see the HTML sample's root tag for a sample). The documentation talks about this attribute too.

The HtmlDynamicSyntaxLanguage code-behind class for the sample HTML language shows how to pop up a member list. If you are looking to do quick info and parameter info, our "Simple" language sample shows how to do those features as well.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 6 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.