//在RichEdit1中增加一行,内容是Edit1的内容<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> cr: TCharRange;<br> s: String;<br>begin<br> cr.cpMin := Length(RichEdit1.Lines.Text) + 1;<br> cr.cpMax := cr.cpMin;<br> s := #13#10 + Edit1.Text + #13#10;<br> SendMessage(RichEdit1.Handle, EM_EXSETSEL, 0, LongInt(@cr));<br> SendMessage(RichEdit1.Handle, EM_REPLACESEL, 1, LongInt(PChar(s)));<br> //上面一句中,1表示操作完成后可以按Ctrl+Z来撤销<br> //如果为0,则不能撤销<br>end;<br>