Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Point nach Str? (https://www.delphipraxis.net/147935-point-nach-str.html)

AlexII 19. Feb 2010 11:28


Point nach Str?
 
Wer kann mir sagen wie man Point nach String umwandelt?

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var p: TPoint;
begin
p := ScreenToClient(Mouse.CursorPos);
ShowMessage(????PointToStr(p));             <- kann hier nämlich die "p" nicht ausgeben
end;
Danke!

himitsu 19. Feb 2010 11:30

Re: Point nach Str?
 
Ein TPoint besteht aus 2 Integern ... wie wäre es also, wenn du diese Integer einzeln umwandelst?

Bernhard Geyer 19. Feb 2010 11:31

Re: Point nach Str?
 
Wir wäre es mit Format?

Delphi-Quellcode:
Format('x=%d, y=%d', [p.x, p.y]);

DeddyH 19. Feb 2010 11:31

Re: Point nach Str?
 
Delphi-Quellcode:
function PointToStr(aPoint: TPoint): string;
begin
  Result := Format('X: %d, Y: %d',[aPoint.X, aPoint.Y]);
end;
[edit] *Huch*, wo kommen die Antworten denn plötzlich her? :shock: [/edit]


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:19 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