Когда я пытаюсь добавить в делфи Form2.ShowModal; пишет ошибку: "Undeclared identifier 'Form2' at (указывает линию)"
Вот код unit1:
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, GifImg, Vcl.ExtCtrls, Vcl.StdCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Gif : TGifImage;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.Visible := false;
Form2.ShowModal;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Gif := TGifImage.Create;
Gif.LoadFromFile('C:\Users\Artem\Desktop\vrr.3321\video\render\Untitled.gif');
Gif.Animate := True;
Image1.Picture.Assign(GIF);
end;
end.
Код unit2(второй формы):
unit Unit2;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs;
type
TForm2 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.FormCreate(Sender: TObject);
begin
end;
end.
Скажите, пожалуйста в чем проблема
Заранее спасибо!