F
fei_l
Unregistered / Unconfirmed
GUEST, unregistred user!
以下程序可以解决你的一些输入显示问题。<br>但是在判断一次输入字符的数量时(目的是取相同长度的字符作比较),还要作完善<br>procedure TForm1.RichEdit1Change(Sender: TObject);<br>var CurLen:integer;<br>begin<br> CurLen:=Length(RichEdit1.Text);<br> RichEdit1.SelStart:=CurLen-2;<br> RichEdit1.SelLength:=CurLen;<br> if Pos(RichEdit1.SelText,'对照字符')=0 then<br> RichEdit1.SelAttributes.Color:=clblue<br> else RichEdit1.SelAttributes.Color:=clRed;<br> RichEdit1.SelStart:=CurLen;<br> RichEdit1.SelLength:=0;<br>end;<br>