procedure TForm1.Edit1Exit(Sender: TObject);
begin
if edit1.Text='' then
begin
label4.Caption:='用户名不能为空';
label4.Font.Color:=clred;
end
else
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Text:='select * from DL where ID='''+EDIT1.Text+'''';
ADOQUERY1.Open;
if adoquery1.RecordCount<>0 then
begin
label4.Caption:='该用户名以存在';
label4.Font.Color:=clred;
end
else
begin
label4.Caption:='';
label4.Font.Color:=clbtnface;
end;
end;
end;
procedure TForm1.Edit2Exit(Sender: TObject);
begin
if edit2.Text='' then
begin
label5.Caption:='请输入密码';
label5.Font.Color:=clred;
end
else
begin
label5.Caption:='';
label5.Font.Color:=clbtnface;
end;
end;
procedure TForm1.Edit3Exit(Sender: TObject);
begin
if edit3.Text='' then
begin
label6.Caption:='请输入密码';
label6.Font.Color:=clred;
end
else
begin
if edit3.Text<>edit2.Text then
begin
label6.Caption:='确认密码不一致';
label6.Font.Color:=clred;
end
else
begin
label6.Caption:='';
label6.Font.Color:=clbtnface;
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
form1.Close;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if edit1.Text='' then
begin
label4.Caption:='用户名不能为空';
label4.Font.Color:=clred;
showmessage('您填写的信息有错误,请跟据提示修改!');
end
else
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Text:='select * from DL where ID='''+EDIT1.Text+'''';
adoquery1.Open;
if adoquery1.RecordCount<>0 then
begin
label4.Caption:='该用户名以存在';
label4.Font.Color:=clred;
showmessage('您填写的信息有错误,请跟据提示修改!');
end
else
begin
label4.Caption:='';
label4.Font.Color:=clbtnface;
end
end;
if edit2.Text='' then
begin
label5.Caption:='请输入密码';
label5.Font.Color:=clred;
showmessage('您填写的信息有错误,请跟据提示修改!');
end
else
begin
label5.Caption:='';
label5.Font.Color:=clbtnface;
end;
if edit3.Text='' then
begin
label6.Caption:='请输入密码';
label6.Font.Color:=clred;
showmessage('您填写的信息有错误,请跟据提示修改!');
end
else
begin
if edit3.Text<>edit2.Text then
begin
label6.Caption:='确认密码不一致';
label6.Font.Color:=clred;
showmessage('您填写的信息有错误,请跟据提示修改!');
end
else
begin
label6.Caption:='';
label6.Font.Color:=clbtnface;
end;
end;
end;
end.
怎么样在TForm1.Button1Click中调用TForm1.Edit1Exit\TForm1.Edit2Exit\TForm1.Edit3Exit.