delphi报错 15
unitstudent;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls...
unit student;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, Buttons, ExtCtrls, jpeg;
type
TForm1 = class(TForm)
StatusBar1: TStatusBar;
Image1: TImage;
Panel1: TPanel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
procedure FormCreate(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
statusBar1.Panels[0].Text := '欢迎使用本系统';
statusBar1.Panels[1].Text := datetostr(date);
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
form2.show;
end;
end.
unit editinfo;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, DBCtrls, Mask, DB, ADODB;
type
TForm2 = class(TForm)
DataSource1: TDataSource;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label9: TLabel;
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
DBEdit3: TDBEdit;
DBEdit4: TDBEdit;
DBEdit5: TDBEdit;
DBMemo1: TDBMemo;
ADOTable1: TADOTable;
DBComboBox1: TDBComboBox;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Button9: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.FormCreate(Sender: TObject);
begin
adotable1.Open;
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
adotable1.Prior;
if adotable1.Bof then
adotable1.Last;
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
adotable1.Next;
if adotable1.Eof then
adotable1.Last;
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
adotable1.First;
end;
procedure TForm2.Button4Click(Sender: TObject);
begin
adotable1.Last;
end;
procedure TForm2.Button5Click(Sender: TObject);
begin
adotable1.Append;
button6.Enabled := true;
button5.Enabled := false;
button7.Enabled := true;
end;
end.
不知为什么form2.show;报错了
[Pascal Error] student.pas(1): Unable to invoke Code Completion due to errors in source code 展开
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, Buttons, ExtCtrls, jpeg;
type
TForm1 = class(TForm)
StatusBar1: TStatusBar;
Image1: TImage;
Panel1: TPanel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
procedure FormCreate(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
statusBar1.Panels[0].Text := '欢迎使用本系统';
statusBar1.Panels[1].Text := datetostr(date);
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
form2.show;
end;
end.
unit editinfo;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, DBCtrls, Mask, DB, ADODB;
type
TForm2 = class(TForm)
DataSource1: TDataSource;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label9: TLabel;
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
DBEdit3: TDBEdit;
DBEdit4: TDBEdit;
DBEdit5: TDBEdit;
DBMemo1: TDBMemo;
ADOTable1: TADOTable;
DBComboBox1: TDBComboBox;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Button9: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.FormCreate(Sender: TObject);
begin
adotable1.Open;
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
adotable1.Prior;
if adotable1.Bof then
adotable1.Last;
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
adotable1.Next;
if adotable1.Eof then
adotable1.Last;
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
adotable1.First;
end;
procedure TForm2.Button4Click(Sender: TObject);
begin
adotable1.Last;
end;
procedure TForm2.Button5Click(Sender: TObject);
begin
adotable1.Append;
button6.Enabled := true;
button5.Enabled := false;
button7.Enabled := true;
end;
end.
不知为什么form2.show;报错了
[Pascal Error] student.pas(1): Unable to invoke Code Completion due to errors in source code 展开
3个回答
展开全部
1.在FORM1中引用 editinfo
2.看是否在工程文件中创建,如果没有按照楼上的做,如果已经创建还不行用show.ShowModal 试试
2.看是否在工程文件中创建,如果没有按照楼上的做,如果已经创建还不行用show.ShowModal 试试
追问
确实在加了这个就好了 不知道 这是什么意思
form2:=tform2.create(nil);
form2.show;
追答
说明你的工程文件没有 创建这个窗体,需要手动创建
form2:=tform2.create(nil); 这个就是创建窗体
form2.show;这个是显示窗体,如果这个窗体没有在内存中你怎么显示,所以要先创建到内存中
启帆信息
2024-11-19 广告
2024-11-19 广告
启帆信息是英伟达中国区代理商,原厂授权代理,提供全面的软件技术解决方案以及NVIDIA以太网产品、交换机等产品,欢迎前来咨询!...
点击进入详情页
本回答由启帆信息提供
展开全部
uses editinfo;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
form2:=tform2.create(nil);
form2.show;
end;
begin
form2:=tform2.create(nil);
form2.show;
end;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询