ysmstoneman(迪蜚) (2002-1-27 19:26:58) 得0分
先在Unit1里uses unit2;
我已经这样做了还是不行呀
先在Unit1里uses unit2;
我已经这样做了还是不行呀
解决方案 »
- mapx求助
- Delphi7数据模块调用sql server 2000存储过程的问题
- 为什么我写的东西保存后,第二天就打不开了
- Form1和Form2 之间的数据传递
- 怎么用Delphi6连接oracle数据库?
- 关于用消息向其它应用程序发送文本的问题?
- 关于delphi7中的Corba问题
- ?我刚刚完成一个用DELPHI开发的反黄软件,欢迎大家下载。多发表高见! www.zhengquan518.com/downloads/disk1.zip 软件密码:000000
- 如何发送手机短信息?
- 为了安全,我在Paradox的一个表内用了密码,但是希望在程序中不要输入表的密码。我想用Session.AddPassword(‘password');但是这局话要加在那里?
- 怎样在EDIT框内只能输入数字
- 求助 119
table1.Append;
form2.showmodal;
就够了,然后在unit2中加入
if form1.table1.CanModify then
// table1.Edit;
form1.table1.Post
else
begin
form1.table1.Cancel;
showmessage('buneng xiugai');
end;
close;
就Ok了
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, Grids, DBGrids, DBTables, StdCtrls;type
TForm1 = class(TForm)
Table1: TTable;
DBGrid1: TDBGrid;
DataSource1: TDataSource;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementationuses Unit2;{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
table1.Append;
form2.showmodal;{ if table1.CanModify then
begin
// table1.Edit;
if form2.ShowModal=mrOk then
table1.Post
else
table1.Cancel;
end
else
showmessage('buneng xiugai'); }
end;end.
unit Unit2;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask, DBCtrls;type
TForm2 = class(TForm)
Button1: TButton;
DBEdit1: TDBEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form2: TForm2;implementationuses Unit1;//uses unit1;{$R *.dfm}procedure TForm2.Button1Click(Sender: TObject);
begin
{if Form1.table1.CanModify then
begin
Form1.table1.Edit;
if form2.ShowModal=mrOk then
Form1.table1.Post
else
Form1.table1.Cancel;
end
else
showmessage('buneng xiugai');}
if form1.table1.CanModify then
// table1.Edit;
form1.table1.Post
else
begin
form1.table1.Cancel;
showmessage('buneng xiugai');
end;
close;
end;end.