unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementationuses Unit2;{$R *.dfm}procedure TForm1.Timer1Timer(Sender: TObject);
begin
form1.close;
login.showmodal;
end;end.form1可以正常关闭,login窗口却不能正常显示出来,这是什么原因????
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementationuses Unit2;{$R *.dfm}procedure TForm1.Timer1Timer(Sender: TObject);
begin
form1.close;
login.showmodal;
end;end.form1可以正常关闭,login窗口却不能正常显示出来,这是什么原因????
我给你发信息了,你看下好么?
修改dpr文件
Form2:=TForm2.Create(Application); //Form2是一个显示一张图片的启动窗体
Form2.Show;
Form2.Update;
Application.CreateForm(TForm1, Form1);//Form1就是程序的主窗体
Form2.Close;
Application.Run;To waiwaizz()
我已经给你发邮件了
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementationuses Unit2;{$R *.dfm}procedure TForm1.Timer1Timer(Sender: TObject);
begin
form1.close;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
Form1:=TForm1.Create(Application); //Form1是一个显示一张图片的启动窗体
Form1.Show;
Form1.Update;
Application.CreateForm(TForm2, Form2);//Form2就是程序的主窗体
Form1.Close;
Application.Run;
end;end.
Form1.Update;
Forms,
Form2 in 'Form2.pas' {frmForm2},
Form1 in 'Form1.pas' {frmForm1},{$R *.RES}begin
Application.Initialize;
Form2:=TForm2.Create(Application); //Form2是一个显示一张图片的启动窗体
Form2.Show;
Form2.Update;
Application.CreateForm(TForm1, Form1);//Form1就是程序的主窗体
Form2.Close;
Application.Run;
end.
Form1.Update;已经按照你的方法改了,提示sleep错误哦,是否单词有误?
另外,sleep的问题还没搞定,希望脑脑帮我改改.谢谢了.
2.这段代码是否是用静态form来实现的.
3.你能写一个用代码来建立form的程序吗?我现在不想用file-new-form这样操作来新建form.1.pas文件在保存时命名就可以了2.是的3.在主窗体代码中加入
procedure TfrmMain.N1Click(Sender: TObject);//N1为创建按钮
begin
frmNew1:=TFrmNew1.create(application);
frmNew1.showmodal;
end;
放到Project单元中的
begin
Application.Initialize;
//添加代码行
Form1:=TForm1.Create(Application); //Form1是一个显示一张图片的启动窗体
Form1.Show;
Form1.Update;
Application.CreateForm(TForm2, Form2);//Form2就是程序的主窗体
Form1.Close;
Application.Run;
end;