|
通过登录窗体验证之后,进入主窗体,然后想在这个时候关掉登录窗体,于是写了
procedure TDLCT.btnLoginClick(Sender: TObject);
var
LegalUser : integer;
lDetailForm : TMFZBYRZGL;
begin
LegalUser:=0;
with dsbZBYBSJJ do
begin
DataSet.Open;
DataSet.First;
while not DataSet.Eof do
begin
if (edtUserName.Text=DataSet.FieldByName('ZBYMC').AsString) and
(edtPassWord.Text=DataSet.FieldByName('ZBYMM').AsString) then
begin
jsDialogs.ShowMsg('合法用户','提示信息');
self.Free;
LegalUser:=1;
lDetailForm := TMFZBYRZGL.Create(Context);
try
lDetailForm.ShowModal;
finally
lDetailForm.Free;
end;
break;
end;
DataSet.Next;
end;
end;
//if LegalUser=1 then
// self.Free;
if LegalUser=0 then
jsDialogs.ShowWarning('用户名或者密码错误','错误信息');
end;
运行的时候正常,但是关闭主窗体的时候会报图片的那个错误
|
|