1. 过程如下
procedure TForm1.Button1Click(Sender: TObject);
var
i, CountWords:integer;
begin
CountWords:=0;
for i:=0 to Memo1.Lines.Count-1 do
CountWords:=CountWords+length(Memo1.Lines);
ShowMessage(inttostr(CountWords));
end;
2.Memo的OnChange事件
如:
procedure TForm1.Memo1Change(Sender: TObject);
begin
ShowMessage('Changed');
end;