The caret of RadSyntaxEditor is a vertical 'blinking' line that represents the current cursor position of a control that accepts text input. The appearance of the caret can be controlled by the CaretDisplayMode property. There are 4 different modes that you can choose from - Normal, Block, HalfBlock and QuarterBlock. The resulting appearance can be observed in Figure 1.

Figure 1: Caret's display mode

  • Normal - features-caret001
  • Block - features-caret001
  • HalfBlock - features-caret001
  • QuarterBlock - features-caret004

Setting the caret's display mode

this.radSyntaxEditor1.CaretDisplayMode = CaretDisplayMode.QuarterBlock;

Me.RadSyntaxEditor1.CaretDisplayMode = CaretDisplayMode.QuarterBlock

Hide the Caret

If you want to hide the caret, you can do so by setting the IsCaretVisible property to false. This setting can be used along with the IsReadOnly property which disallows users from making changes in the editor.

Setting the caret's display mode

this.radSyntaxEditor1.IsCaretVisible = false;
this.radSyntaxEditor1.SyntaxEditorElement.IsReadOnly = true;

Me.RadSyntaxEditor1.IsCaretVisible = False
Me.RadSyntaxEditor1.SyntaxEditorElement.IsReadOnly = True

Caret Color

Through the CaretColor property, you can change the caret's color to a color of your liking. The default color is Black.

Setting the caret's color

this.radSyntaxEditor1.CaretColor = Color.Red;

Me.RadSyntaxEditor1.CaretColor = Color.Red

Figure 2: RadSyntaxEditor caret with red color


In this article
Not finding the help you need? Improve this article