1.我想要RichEdit的每5个字符一种颜色?怎么办?
2.怎样在richedit的背景上画一些横线,做出类似稿纸的效果?
3.那种全屏效果怎么做?
对于第一个问题,可以这样像这样做:
//在button1的onclick事件中写如下代码(演示):
procedure TForm1.Button1Click(Sender: TObject);
Var
len,jsq:LongInt;
begin
len:=length(richedit1.Lines.Text);
if len<=0 then
exit;
randomize;
jsq:=0;
while jsq<len do
begin
richedit1.SelStart:=jsq;
richedit1.SelLength:=5;
richedit1.SelAttributes.Color:=rgb(random(255),random(255),random(255));
jsq:=jsq+5;
end;
end;