November 25th, 1999, 06:45 AM
I want to select a portion of a string. I do not want to select it from left to right but from right to left...
Example:
I want selstart to be at 6
and I want it to end at 3
Basicly I want the cursor at the beginnning of the selection, not at the end.
Ravi Kiran
November 26th, 1999, 02:04 AM
NOT Possible, as far as i KNOW.
If you look into MSDN, in EM_SETSEL textbox message setion, this is what is said:
"...If the nStart parameter is 0 and the nEnd parameter is -1, all the text in the edit control is selected. If nStart is -1, any current selection is removed. The caret is placed at the end of the selection indicated by the greater of the two values nEnd and nStart.
Since this msg is the base for seletion, i think it is not possible in simple manner, unless you subclass it and paint the strings yourself etc..
Anyway the purpose of selection is to say that the next character being typed will replace the complete set of them!.So caret position is "kind of" in correct place, if it is after the selection!, because the char shoud appear BEFORE the caret
RK