Einzelnen Beitrag anzeigen

JoelH
(Gast)

n/a Beiträge
 
#9

hmm,

  Alt 17. Jul 2003, 13:05
Jipee,

es geht jetzt, ich dacht schon ich bin doof. Hatte mich wohl etas mit dem Def und Sel verzettelt. Die OnlineHilfe dazu ist aber auch mau.

Delphi-Quellcode:
procedure Tform2.ersetzeText(bildschirmrtf:TRichEdit;finden,ersetzen:String);
var position, lf, le : integer;
    helprtf : TRichEdit;
    attrib : TTextattributes;
begin
  helprtf := TRichEdit.Create(self);
  helprtf.parent := bildschirmrtf.Parent;
  lf := length(finden);
  le := length(ersetzen);
  helprtf.Clear;
  bildschirmrtf.SelStart := pos(finden,bildschirmrtf.text)-1;
  bildschirmrtf.SelLength := lf;
  attrib := bildschirmrtf.SelAttributes;
  helprtf.Lines.add(ersetzen);
  helprtf.SelAttributes := attrib;
  helprtf.SelStart := pos(ersetzen,helprtf.text)-1;
  helprtf.SelLength := le;
  helprtf.SelAttributes.Size := attrib.size;
  helprtf.SelAttributes.Name := attrib.Name;
  helprtf.CopyToClipboard;
  bildschirmrtf.PasteFromClipboard;
  bildschirmrtf.SelStart := pos(ersetzen,bildschirmrtf.text)-1;
  bildschirmrtf.SelLength := le;
  bildschirmrtf.SelAttributes := attrib;
  helprtf.destroy;
end;
  Mit Zitat antworten Zitat