[英]How to set the code selection programatically in AvalonEdit?
我在Microsoft Surface应用程序中使用AvalonEdit。 由于联系人的处理方式与普通的WPF应用程序略有不同,我想以编程方式设置代码选择。
通过代码选择我的意思是代码的这部分,如果用户用鼠标选择它,背景就会改变。
我现在是DocumentLine或VisualLine,选择应该从哪里开始,应该在哪里结束。 但是我现在怎么做这个选择呢?
this.Editor
是AvalonEdit
对象, selectionStart
是相对于正在编辑的文本的开头的偏移量。
this.Editor.SelectionStart = selectionStart;
this.Editor.SelectionEnd = selectionStart + selectionLength;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.