c# - Move caret to start and end of line in a RichEditBox -
i've richeditbox i'd add keyboard shortcut support enable moving start or end of line caret on. i've figured out shortcuts supporting going start or end of sentence involved reviewing text value of content , finding nearest period. however, believe i'm looking more involved requires working through raw content of file, i'm not comfortable nor have managed find resources guidance i'm after (i've found answers on detecting eol character type rather moving caret eol).
if want move caret, can use richeditbox.document.selection.move
method move insertion point forward or backward specified number of units.
we can set textrangeunit.line
move
method, move caret start or end of line in richeditbox.
for example:
myrichedit.document.selection.move(textrangeunit.line, 1);
Comments
Post a Comment