How to configure programmatic selection in AvalonEdit?

I am using AvalonEdit in a Microsoft Surface application. Since contacts are handled a little differently than in a regular WPF application, I want to programmatically select a code selection.

When choosing a code, I mean this part of the code that changes the background if the user selects it with the mouse.

Now I am a DocumentLine or VisualLine where the selection should begin and where it should end. But how can I make this choice?

+4
source share
1 answer

this.Editor - this.Editor object, selectionStart offset from the beginning of the edited text.

  this.Editor.SelectionStart = selectionStart; this.Editor.SelectionEnd = selectionStart + selectionLength; 
+3
source

Source: https://habr.com/ru/post/1345232/


All Articles