Read SelStart to determine the position of the first selected character, where 0 indicates the first character.Read SelLength to determine the length, in bytes, of the selected text. This is the same as the number of characters, unless you are using a multi-byte character set.自己动手,有益进步。
RichEdit1.SelLength:=1;
RichEdit1.SelAttributes.Color := clred;
1。SelStart应该是以第一个字节为第0位,第2个字节为第1位?
2。SelLength选择的长度是跟SubString后面那个长度取法是否一致?
begin
Color:=..
end;