Richedit每行最后单词可以拆分显示的问题,急!!!(200)

Z

zjting

Unregistered / Unconfirmed
GUEST, unregistred user!
现把Richedit设为自动分行,导入英语文章时,最后如果遇到一个单词时,它会自动换行到下一行显示,这样不是很美观,每行长长短短。我需要每行显示固定的长宽,遇到单词也要拆开显示。比如下面吧原来的:Lesson One TEXT What is a Computer A computer is a machine that takes in informaitonand processes that 现在想变成这样的:Lesson One TEXT What is a Computer A computer is a machine that takesin informaiton and processes that 谢谢大虾们,给个解决方法吧。谢谢!
 
procedure TForm1.Button1Click(Sender: TObject);vars:string;begins:='Lesson One TEXT What is a Computer A'+'computer is a machine that takes in informaiton'+'and processes that';s:=stringreplace(S,' ',#127,[rfReplaceAll]);RichEdit1.Text:=s;end;/////偷懒的方法,王道应该是用消息
 
把所有的字符进行等长度截取,然后加到richedit中去代码按20取while true do begin MidStr(字符串,(i-1)20,i*20) inc(i); if 已经取到最后 then 退出 end
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
703
import
I
D
回复
0
查看
1K
DelphiTeacher的专栏
D
顶部