比如:
richedit1.line.add('赤橙黄绿青蓝紫');
如何分别显示他们的颜色,“赤”是红色的,“橙”是橙色的......
如果不行,有什么第三方控键可以做到。
如何安装?

解决方案 »

  1.   

    用Riched20.dll生写richedit控件吧。
    还可以看盾rxLib2.75里面的东西怎么样。
      

  2.   

    RichEdit1.Clear;
      RichEdit1.Lines.Add('赤橙黄绿青蓝紫');
      with richedit1 do
      begin
        SelStart :=0;
        SelLength := 2;
        SelAttributes.Color := clRed;
        SelStart :=2;
        SelLength := 2;
        SelAttributes.Color := clYellow;//自己找橙色
        SelStart :=4;
        SelLength := 2;
        SelAttributes.Color := clYellow;
        SelStart :=6;
        SelLength := 2;
        SelAttributes.Color := clGreen;
        SelStart :=8;
        SelLength := 2;
        SelAttributes.Color := clTeal;
        SelStart :=10;
        SelLength := 2;
        SelAttributes.Color := clBlue;
        SelStart :=8;
        SelLength := 2;
        SelAttributes.Color := clFuchsia;
      end;
      

  3.   

    RichEdit1.SelStart:=0;
    RichEdit1.SelLength:=5;
             RichEdit1.SelAttributes.Color:=clRed;
    RichEdit1.SelLength:=0;