LDL 发表于 2011-12-19 00:55:09

如何实现新窗口的弹出

在Form1窗口中,当发生点击button1按钮事件的时候
如何实现Form2窗口的弹出
具体代码是怎么样的?
为什么我用Form2.Show;
这个语句的时候报错
错误代码如下:

[错误] Unit1.pas(54): Undeclared identifier: 'Form2'
[致命错误] Project1.dpr(6): Could not compile used unit 'Unit1.pas'

G0398 发表于 2011-12-19 11:57:40

还要use Unit2的

川本姨夫 发表于 2011-12-19 12:10:13

新建-窗口

在button的过程里边再写form2.show

LDL 发表于 2011-12-19 23:43:58

川本姨夫 发表于 2011-12-19 12:10 static/image/common/back.gif
新建-窗口

在button的过程里边再写form2.show

我是写的那样的啊,但是还是上面的错误代码、、、

LDL 发表于 2011-12-19 23:44:19

G0398 发表于 2011-12-19 11:57 static/image/common/back.gif
还要use Unit2的

这个是什么意思啊?

G0398 发表于 2011-12-20 13:39:56

LDL 发表于 2011-12-19 23:44 static/image/common/back.gif
这个是什么意思啊?

uses Unit2;
引用第二个窗体的单元文件

wuge1986 发表于 2011-12-22 09:19:25

会的直接写段代码呗。告诉我们啊。

kongkong 发表于 2011-12-22 12:49:29

在form1 中
implementation

uses Unit2;

woxiang126 发表于 2012-1-1 09:58:16

在form1 中 的
implementation下面
uses Unit2;
然后在buttononclicke下
form2.show;
页: [1]
查看完整版本: 如何实现新窗口的弹出