Hi Dave,
1. I confirm that the ConvertOffsetToVirtualPosition method works fine. Note that the origin for this virtual coordinate system is at (1,1) and not (0,0). I have attached a
test sample here that illustrates how you could highlight the offending code in wavy red underlines. Presently the EditControl does not have any APIs to specify a TextRange in terms of VirualPoints. We will add this feature shortly. Till then, you could use the following workaround :
Set the offending section as the selected text using the SetSelection method, underline this selected TextRange and then reset selection using the ResetSelection method as shown in code below :
// Starting offset converted to virtual point
Point pt1 = this.editControl1.ConvertOffsetToVirtualPosition(8);
// Ending offset converted to virtual point
Point pt2 = this.editControl1.ConvertOffsetToVirtualPosition(13);
this.editControl1.SetSelection(pt1.X, pt1.Y, pt2.X, pt2.Y);
ISnippetFormat format = editControl1.RegisterUnderlineFormat(Color.Red, UnderlineStyle.Wave, UnderlineWeight.Thick);
this.editControl1.SetUnderline (this.editControl1.Selection.Top, this.editControl1.Selection.Bottom, format);
this.editControl1.ResetSelection();
Please refer to the sample and let me know if this meets your requirements.
2. I am afraid, this functionality does not exist in the current implementation of the EditControl. However, we have considered this as a feature request and will try our best to implement this as soon as possible. You could track the progress of this feature request at this link below :
Feature Request #345 - Ability to set certain sections of text in the EditControl as read only
We appreciate your patience, and thanks for your continued interest in Syncfusion products.
Regards,
Guru Patwal
Syncfusion, Inc.