When editing text, the user can use the button to switch keys and direction keys to change the selection - one position remains attached and the other moves. By clicking left, you can get the moving part to the left of the fixed part.
I am trying to dynamically modify the selection of users in a WPF TextBox (for discussion, say, I want to select characters in pairs, for example, by pressing shift + left, 2 characters will be selected, not just one). However, when using SelectionStart / SelectionIndex / CaretIndex / Select, the "end end of the selection engine" always ends at the far right end of the selection, making the offset + left combination useless.
Any way to keep the "direction of choice"?
source share