How to set some areas to be unselectable?

SyntaxEditor for WPF Forum

The latest build of this product (v25.1.1) was released 3 months ago, which was before this thread was created.
Posted 2 days ago by Morton
Version: 25.1.1
Avatar

Hello Actipro Developers,

I have a requirement. I set some areas in the SyntaxEditor to be uneditable. However, when I select all, the uneditable areas are also selected, so I can't delete them. I want to be able to delete everything except the uneditable areas normally. Is this possible? Can I set the uneditable areas to be unselectable so that they are not included when I select all?

Thank you!

Comments (3)

Posted 23 hours ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I'm sorry but we don't have any functionality built-in like that.  You would need to get a list of the text ranges that are read-only and then set the view's selection to the inverse of those ranges.  This documentation topic talks about setting selections.  Then calling this should delete all the selected text ranges:

editor.ActiveView.DeleteSelectedText(TextChangeTypes.Delete);


Actipro Software Support

Posted 15 hours ago by Morton
Avatar

Is there a way to programmatically get the position (position or offset) of a special character?

Posted 11 hours ago by Morton
Avatar

I have the following questions:

  1. Can I set the foreground color for read-only areas?
  2. Can I set two non-contiguous code blocks to read-only? According to the case, I can only set one block.

[Modified 8 hours ago]

Add Comment

Please log in to a validated account to post comments.