在RICHEDIT 中使用StringReplace这个字符串替换函数时, 很容易就出现"RichEdit line insertion error".
解决的方法:
TStrings *tmp=new TStringList;//中间变量,用于暂时保存字符串列表的内容 String Spilth=MemoB->Strings[i]; if(Trim(Spilth)!="") { tmp->Text=StringReplace(MemoA->Text,Spilth,"",TReplaceFlags() << rfReplaceAll); } TStringStream *str=new TStringStream(tmp->Text);//使用字符串流来转移数据,这就搞定,而且速度超快!! MemoA->LoadFromStream(str); tmp->Free(); str->Free();
本文来自优快云博客,转载请标明出处:file:///C:/Documents%20and%20Settings/Administrator/桌面/bcb/解决RichEdit%20line%20insertion%20error的方法%20-%20hellogv的专栏%20-%20优快云博客.htm