richedit中内容的选择????(10分)

  • 主题发起人 主题发起人 apiaor
  • 开始时间 开始时间
A

apiaor

Unregistered / Unconfirmed
GUEST, unregistred user!
在我程序运行时,我想自动选种richedit中第20到第80个字符,请问怎么选?当我把内容放到<br>剪切板上以后,我想在清空剪切板,怎么清空?
 
selStart &nbsp;selLength
 
uses clipbrd;<br><br>procedure TForm1.FormShow(Sender: TObject);<br>begin<br>&nbsp; RichEdit1.SetFocus;<br>&nbsp; RichEdit1.SelStart:=20;<br>&nbsp; RichEdit1.SelLength:=80-20;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br>&nbsp; &nbsp;Clipboard.Clear;<br>end;
 
uses clipbrd;<br><br>procedure TForm1.FormActivate(Sender: TObject)<br>begin<br>&nbsp; RichEdit1.SetFocus;<br>&nbsp; RichEdit1.SelStart:=19;//应该从19开始选!<br>&nbsp; RichEdit1.SelLength:=60;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br>&nbsp; &nbsp;Clipboard.Clear;<br>end;
 
后退
顶部