delphi - TButton未声明的标识符

标签 delphi

下面的代码是由Delphi自行设置的,并引发错误


未声明的标识符TButton


unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin

end;

end.


由于它使用了所有必需的单位,为什么会引发错误?

最佳答案

TButton是在Vcl.StdCtrls中定义的,已用单元列表中缺少该元素。通常,当您保存项目时,IDE会将缺少的单元添加到列表中。

关于delphi - TButton未声明的标识符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34835944/

相关文章:

Delphi - 在运行时动态添加所有字段在数据集中生成重复项

rest - 如何在IIS 7上部署DataSnap/REST ISAP dll

wcf - 我可以使用Delphi 2010构建WCF服务器吗?

linux - Ubuntu 和拉撒路

delphi - 如何检测鼠标未移动且按钮仍被按下?

sqlite - 如何在sQlite.sdb(FireDac)中插入字符串?

ios - 我们如何在 Delphi iOS 中使用 Open SSL?

Delphi 对 MkDir 的不明确重载调用

c++ - NT 文件系统上非常小的文件上的 FSCTL_GET_RETRIEVAL_POINTERS 失败

ios - 使用 Beta 版 XCode、OS X 或 IOS 创建的构建不支持 Delphi FMX 外部测试