Einzelnen Beitrag anzeigen

Nikodel

Registriert seit: 11. Jan 2019
20 Beiträge
 
Delphi XE4 Professional
 
#1

VCL-Funktion wird nicht erkannt

  Alt 14. Jan 2019, 11:02
Delphi-Version: XE4
Hallo,
obwohl ich in der Uses-Klausel meines VCL-Programms Vcl.Graphics stehen habe, reklamiert der Compiler Undeklarierter Bezeichner: 'TextWidth'. Die Delphi-Hilfe besagt, dass TextWidth in Vcl.Graphics definiert ist.
Code:
uses
  ShellAPI, Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  System.Classes, System.StrUtils, System.DateUtils, System.Character, System.Math,
  Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Menus, Vcl.ExtCtrls,
  Vcl.ExtDlgs, Vcl.ComCtrls, Vcl.StdCtrls, Winapi.WinInet;
...
TMainForm = class(TForm)
...
private
...
const
...
    len_ltick = 8; // long tick
    border_left = len_ltick+TextWidth('99')+2;
...
Auch wenn ich TextWidth('99') später im Code verwende, kommt dort die gleiche Fehlermeldung.

Wie kann ich sonst noch die Breite von Text auf einer Grafik ermitteln?

Gruß Nikodel
  Mit Zitat antworten Zitat