【问题标题】:Delphi RAD Studio 10.2 Error reading Form1.FormFactor.Width Property FormFactor.Width does not existDelphi RAD Studio 10.2 读取 Form1.FormFactor.Width 属性时出错 FormFactor.Width 不存在
【发布时间】:2023-12-22 04:04:01
【问题描述】:

我对旧版本 XE5 的 RAD Studio 10.2 有一个问题,它工作正常。 它给出了一个异常错误:

“读取Form1.FormFactor.Width属性时出错FormFactor.Width不存在”

当我尝试打开我的主窗体时。

unit FormEmail;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls,
  FMX.Edit, IdMessage, IdBaseComponent, IdComponent, IdTCPConnection,
  IdTCPClient, IdExplicitTLSClientServerBase, IdMessageClient, IdSMTPBase,
  IdSMTP, System.StrUtils,IdSSLOpenSSL, FMX.Controls.Presentation, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Menus, Vcl.StdCtrls, Vcl.ComCtrls;

【问题讨论】:

  • 您将 firemonkey FMX 设备与 VCL 设备混合使用。您不能同时使用两者。
  • @LURD 我认为这是一些新手可能会落入的陷阱。我认为值得将您的评论作为答案。
  • @DSM,好的,完成。

标签: delphi firemonkey


【解决方案1】:

您正在混合 firemonkey FMX 单位和 VCL 单位。它们不能共存。

FormEmail 单元中的使用中删除 VCL 单元,您的代码将编译。

【讨论】:

  • 问题表明 对于旧版本 XE5 它工作正常。那可能吗?如果是这样,可能值得一提的是以前的版本表现不同。
  • @Nil,VCL 中从来没有 FormFactor 属性。我怀疑这段代码确实在 XE5 中编译。