Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Text in Memo an Position(x,y) (https://www.delphipraxis.net/85334-text-memo-position-x-y.html)

Van HelF 29. Jan 2007 14:19


Text in Memo an Position(x,y)
 
Gibt es eine möglichkeit einen text an einer position mit x und y wert in einem memo einzufügen?

marabu 29. Jan 2007 14:29

Re: Text in Memo an Position(x,y)
 
Hallo,

ja sicher geht das. Sind x und y Mauskoordinaten oder Zeile und Position?

Delphi-Quellcode:
procedure MemoInsert(memo: TMemo; x, y: Word; s: String);
var
  line: String;
begin
  line := memo.Lines[Pred(y)];
  Insert(s, line, x);
  memo.Lines[y] := line;
end;
Achte auf die Wertebereiche von X und Y (beide > 0);

Grüße vom marabu


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:23 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz