下面的FromShow事件里的change:=false 说无法识别change 是怎么回事啊!!这不是
关键字段自带的吗???应该不需要声明该变量吧!! 到底怎么回事????帮帮忙
这个不解决后面的窗体就无法创建了!!!急!!!!!unit Unit1_f_kcsp;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Unit1_f_base, DB, ADODB, StdCtrls, ExtCtrls, Grids, DBGrids,
ComCtrls, Buttons, ToolWin;type
TF_kcsp = class(TF_base)
ToolBar1: TToolBar;
BitBtn1: TBitBtn;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
BitBtn2: TBitBtn;
ToolButton3: TToolButton;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
BitBtn5: TBitBtn;
ToolButton6: TToolButton;
BitBtn6: TBitBtn;
ToolButton7: TToolButton;
DBGrid1: TDBGrid;
Panel1: TPanel;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
ComboBox1: TComboBox;
DataSource1: TDataSource;
ADOQuery1: TADOQuery; procedure BitBtn1Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
F_kcsp: TF_kcsp;implementation
uses unit1_f_sbjbcx;
{$R *.dfm}procedure TF_kcsp.BitBtn1Click(Sender: TObject);
begin
inherited;
change:=false;
application.createform(TF_sbjbcx,F_sbjbcx);
f_sbjbcx.ShowModal;
f_sbjbcx.Free;
end;procedure TF_kcsp.BitBtn3Click(Sender: TObject);
begin
inherited;
try
if application.messagebox('是否删除数据','提示',mb_yesno)=id_yes then
adoquery1.Delete;
except
application.MessageBox('不能删除该数据','提示',mb_yesno);
end;
end;procedure TF_kcsp.BitBtn4Click(Sender: TObject);
var
searchwhat:string;
begin
inherited;
panel1.Visible:=not(panel1.visible);
if panel1.Visible=false then
begin
searchwhat:='';
case combobox1.ItemIndex of
0:searchwhat:='tradecode';
1:searchwhat:='fullname';
2:searchwhat:='name';
3:searchwhat:='shortcode';
end;
try
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select * from tb_stock');
sql.Add('where''+searchwhat+'+'like :a order by tradecode');
parameters.ParamByName('a').value:='%'+trim(edit1.text)+'%';
open;
end;
if application.MessageBox('是否刷新表','提示',mb_yesno)=id_yes then
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select * from tb_stock order by tradecode');
open;
end;
except
application.MessageBox('请正确输入条件','提示',mb_ok);
end; end;
end;procedure TF_kcsp.FormShow(Sender: TObject);
begin
inherited;
change:=false;
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select * from tb_stock order by tradecode asc');
open;
end;end;end.unit Unit1_f_base;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ActnList, ToolWin, ActnMan, ActnCtrls, XPStyleActnCtrls,
ComCtrls, StdCtrls, ExtCtrls, Buttons, jpeg;type
TF_base = class(TForm)
procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;var
F_base: TF_base;implementation{$R *.dfm}
procedure TF_base.FormKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
perform(wm_nextdlgctl,0,0);
end;procedure TF_base.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=vk_F5 then
close;
end;end.
关键字段自带的吗???应该不需要声明该变量吧!! 到底怎么回事????帮帮忙
这个不解决后面的窗体就无法创建了!!!急!!!!!unit Unit1_f_kcsp;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Unit1_f_base, DB, ADODB, StdCtrls, ExtCtrls, Grids, DBGrids,
ComCtrls, Buttons, ToolWin;type
TF_kcsp = class(TF_base)
ToolBar1: TToolBar;
BitBtn1: TBitBtn;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
BitBtn2: TBitBtn;
ToolButton3: TToolButton;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
BitBtn5: TBitBtn;
ToolButton6: TToolButton;
BitBtn6: TBitBtn;
ToolButton7: TToolButton;
DBGrid1: TDBGrid;
Panel1: TPanel;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
ComboBox1: TComboBox;
DataSource1: TDataSource;
ADOQuery1: TADOQuery; procedure BitBtn1Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
F_kcsp: TF_kcsp;implementation
uses unit1_f_sbjbcx;
{$R *.dfm}procedure TF_kcsp.BitBtn1Click(Sender: TObject);
begin
inherited;
change:=false;
application.createform(TF_sbjbcx,F_sbjbcx);
f_sbjbcx.ShowModal;
f_sbjbcx.Free;
end;procedure TF_kcsp.BitBtn3Click(Sender: TObject);
begin
inherited;
try
if application.messagebox('是否删除数据','提示',mb_yesno)=id_yes then
adoquery1.Delete;
except
application.MessageBox('不能删除该数据','提示',mb_yesno);
end;
end;procedure TF_kcsp.BitBtn4Click(Sender: TObject);
var
searchwhat:string;
begin
inherited;
panel1.Visible:=not(panel1.visible);
if panel1.Visible=false then
begin
searchwhat:='';
case combobox1.ItemIndex of
0:searchwhat:='tradecode';
1:searchwhat:='fullname';
2:searchwhat:='name';
3:searchwhat:='shortcode';
end;
try
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select * from tb_stock');
sql.Add('where''+searchwhat+'+'like :a order by tradecode');
parameters.ParamByName('a').value:='%'+trim(edit1.text)+'%';
open;
end;
if application.MessageBox('是否刷新表','提示',mb_yesno)=id_yes then
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select * from tb_stock order by tradecode');
open;
end;
except
application.MessageBox('请正确输入条件','提示',mb_ok);
end; end;
end;procedure TF_kcsp.FormShow(Sender: TObject);
begin
inherited;
change:=false;
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('select * from tb_stock order by tradecode asc');
open;
end;end;end.unit Unit1_f_base;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ActnList, ToolWin, ActnMan, ActnCtrls, XPStyleActnCtrls,
ComCtrls, StdCtrls, ExtCtrls, Buttons, jpeg;type
TF_base = class(TForm)
procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;var
F_base: TF_base;implementation{$R *.dfm}
procedure TF_base.FormKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
perform(wm_nextdlgctl,0,0);
end;procedure TF_base.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=vk_F5 then
close;
end;end.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货