5,388
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
begin
Memo1.Lines.Append(' '); //空两个
Key := #0; //忽略原来的回车换行
Memo1.SelStart := Length(Memo1.Text) - 1; //重新定位
end;
end;
var MyList:TStringList;
S:string;
begin
MyList:=TStringList.Create;
MyList.Text:=Memo1.Text;
for i:=MyList.Count-1 downto 0 do
begin
S:=Trim(MyList.Strings[i]);
MyList.Strings[i]:=' '+S;
end;
Memo1.Text:=MyList.Text;
MyList.Free;
end;