解决RichEdit line insertion error的方法(转载)

    技术2022-05-20  43

    在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 and Settings/Administrator/桌面/bcb/解决RichEdit line insertion error的方法 - hellogv的专栏 - 博客.htm


    最新回复(0)