能不能在RichEdit中实现对任意位置的字的颜色的改变.
比如我想第2行的第3个字是红色.如果能,请举例说明.

解决方案 »

  1.   

    RichEdit1.SelStart:=2;
      RichEdit1.SelLength:=1;
      RichEdit1.SelAttributes.Color := clred;
      

  2.   

    有几个问题
    1。SelStart应该是以第一个字节为第0位,第2个字节为第1位?
    2。SelLength选择的长度是跟SubString后面那个长度取法是否一致?
      

  3.   

    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.自己动手,有益进步。
      

  4.   

    RichEdit的功能不够强,用这个:http://218.56.11.178:8020/web/index.aspx-》下载基地-》例程-基础应用-》RichEdit中插入图片
      

  5.   

    with Richedit.SelAttributes do
    begin
      Color:=..
    end;