unable to invoke program 怎么解决
- 提问者网友:贪了杯
- 2021-02-10 08:00
- 五星知识达人网友:街头电车
- 2021-02-10 08:41
- 1楼网友:鸠书
- 2021-02-10 09:54
unit formdepartment;
interface
uses
windows, messages, sysutils, variants, classes, graphics, controls, forms,
dialogs, stdctrls, dbctrls, mask, grids, dbgrids, extctrls, db, dbtables;
type
tformdepartme = class(tform)
tbldepart: ttable;
tblvalid: ttable;
dsdepart: tdatasource;
dbndepart: tdbnavigator;
dbgdepart: tdbgrid;
btnquit: tbutton;
dbedepartid: tdbedit;
dbedepartname: tdbedit;
dbehead: tdbedit;
dbetelphone: tdbedit;
dbmdesc: tdbmemo;
label1: tlabel;
label2: tlabel;
label3: tlabel;
label4: tlabel;
private
{ private declarations }
public
{ public declarations }
end;
var
formdepartme: tformdepartme;
implementation
{$r *.dfm}
end.
procedure tformdepartme.togglemode;
var
strmsg:string;
procedure enableinput(enabled:boolean);
begin
dbgdepart.enabled:=not enabled;
dbedepartid.enabled:=enabled;
dbedepartname.enabled:=enabled;
dbehead.enabled:=enabled;
dbetelphione.enabled:=enabled;
dbmdesc.enabled:=enabled;
end;
begin
case tbldepart.state of
dsinsert.dsedit:
begin
enableinput(true);
dbndepart.visiblebuttons:=[nbpost,nbcancel];
dbedepartid.setfocus;
end;
else
enableinput(false);
dbndepart.visiblebuttons:=[nbfirst,nbprior,nbnext,nblast,nbinsert,nbdelete,nbedit,nbpost,
nbcancel,nbrefresh];
end;
if(tbldepart.state=dsedit)and hasclass(strmsg) then
begin
showmessage(strmsg);
dbedepartid.enable:=false;
end;
end;
end. //应该是少了这里吧.