procedure createform(s:string;frm:form);
begin
s:='tform2';
application.createfrom(s,frm);
end;
不能執行,内存地址出错,請幫手!
begin
s:='tform2';
application.createfrom(s,frm);
end;
不能執行,内存地址出错,請幫手!
解决方案 »
- 求算法,请高手指点
- dbgrid怎么才能在输入的时候降焦点锁定此行 不允许键盘鼠标向其他行移动
- 两个dxcurrencyedit中的数据如何相加啊,加结果在第三个dxcurrencyedit中显示
- 字段查询
- 問一下在delphi中關于SQL Explore 的功能問題﹗不解中....
- 菜单动态生成
- 用DELPHI如何连接AUTOCAD2000????急!急!急!急!急! 高分
- 问两个有点难度的问题:怎样声明及使用API 和 ActiveX DLL?
- 兔子有一个忙需要大家的帮忙,请帮帮我好吗?100分相赠!~~~~~~~~~~~
- 请高手把下面代码改写成Delhpi,谢谢!
- 向Delphi的数据设计高手们请教!
- 一个问题:如何将程序所在的文件夹设定为 操作系统文件,隐藏起来。
第一个参数是要创建的组件类型,第二个参数则是对创建的对象的引用。
而你的第一个参数是个字符型的,显示不能编译通过呀!!
而且你写的Form也是不对的,应该TForm
给你写了个小例子
Form1unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,Unit2;type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
TFormClass =class of TForm;
var
Form1: TForm1;implementation
{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
s: TFormClass;
begin
s:=TForm2;
Application.CreateForm(s,Form2);//动态创建
Form2.Show;
end;end.Form2
unit Unit2;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;type
TForm2 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;var
Form2: TForm2;implementation{$R *.dfm}end.