Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   Delphi Inkompatible Typen TPoint und Integer (https://www.delphipraxis.net/201021-inkompatible-typen-tpoint-und-integer.html)

delphicoder123 16. Jun 2019 21:45

Inkompatible Typen TPoint und Integer
 
Hallo,
warum bekomme ich in dieser Zeile Code folgenden Fehler: Inkompatible Typen TPoint und Integer
f ist vom Typ TForm
f.ScreenToClient(Mouse.CursorPos.X).X müsste doch ein Integer und kein Point sein.

Code:
f.ScreenToClient(Mouse.CursorPos.X).X >= 10

scrat1979 16. Jun 2019 22:00

AW: Inkompatible Typen TPoint und Integer
 
Zitat:

Zitat von delphicoder123 (Beitrag 1434769)
Hallo,
warum bekomme ich in dieser Zeile Code folgenden Fehler: Inkompatible Typen TPoint und Integer
f ist vom Typ TForm
f.ScreenToClient(Mouse.CursorPos.X).X müsste doch ein Integer und kein Point sein.

Code:
f.ScreenToClient(Mouse.CursorPos.X).X >= 10

Das Ergebnis ist auch ein Integer-Wert, was aber nicht passt ist Dein Argument Mouse.CursorPos.X.

Delphi-Quellcode:
function ScreenToClient(const Point: TPoint): TPoint;
Die Function erwartet als PARAMETER ein TPoint, bei Dir wäre es allerdings der X-Wert eines T-Point, also fälschlicherweise ein Integer.


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