当前位置:主页>销售管理软件> 列表

Tmemo里面内容如何变色? 找设备管理软件免费版

财务软件版1楼: 我在MEMO1里面输入内容的时候,我想把两个空格之间的单词变成红色,比如,我输入:
this is my thing!
that is your thing!
我在输入的时候就要把is,my,is,your的颜色变成红色,该怎么样做呢?
请高手多多指教!

2楼: 请高手多多指教呀,告诉我一个方法 如设备管理软件免费版

3楼: Memo不好实现。用RichEdit控件好做。

4楼: 那richedit怎么样做呢?

5楼: procedure TShowFmInfo.AppendInfo(sInfo: string; tInfo: TInfoType);
const
InfoColor: array[TInfoType] of TColor = (
clBlack,
clBlack,
clBlack
);
InfoSize: array[TInfoType] of Byte = (
9,
9,
9
);
var
TextLen, InfoLen, sLen: Integer;
begin
with FRichEdit do
begin
Lines.Append('' '' + sInfo);
//Lines.Append(''''); {空一行}
TextLen := Length(Text);
InfoLen := Length(sInfo);

SelStart := TextLen - InfoLen - 2;
SelLength := InfoLen;
SelAttributes.Color := InfoColor[tInfo];
SelAttributes.Size := InfoSize[tInfo];
end;
end;

6楼: 对!
用Richedit,你可以看一下delphi自带的Demo
D:\Program Files\Borland\Delphi7\Demos\RichEdit
呵呵
别忘了给分啊

财务软件版7楼: 那在memo里面就不能这样去做吗?

好象memo里面也有这样的属性嘛

8楼: 好象不能,只能用Richedit