如题:
解决方案 »
- 怎么做字符串的反转,要求最优算法
- 局域网即时通信软件中如何实现上线下线 提示,如何传送文件???
- 祝大家周末愉快
- 关于流媒体压缩的问题xvidcore的问题
- 有关intraweb和ADO之间事?
- 请问做外挂报表用什么比较好
- ord函数是?
- 求救:Paradox表 Croupt index in ...\abc.db问题咋办 ??????
- 快来救命呀,我遇到一个关于创建Paradox表的问题,如果我以后再也遇不到这么难的问题怎么办????
- 高分求示例源码:从ACESS数据库中读、建、改TREEVIEW内容的DEPHI例子!
- 请问有什么办法可以对webbrowser局部放大?
- 如何使用FileListBox实现VSS中添加文件时文件列表中不显示已添加文件信息?
unit2需要uses unit1,然后在代码中调用。
unit2里 use unit1
然后form2.函数就可以用了啊。
uses dialogs;procedure hello;implementationprocedure hello;
begin
ShowMessage('hello world');
end;end.
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation
uses unit2;
{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
hello;
end;end.
unit2里 use unit1
然后form2.函数 的形式调用unit1里面的函数
在你的函数前面加上TForm1.
差不多,在要调用的unit中的implementation下写uses + 调用的unit名字,就可以调用其中的属性、方法