Funcao que retorno o formulario ativo, tem como fazer isto?

Delphi

02/05/2003

Pessoal vc´s como eu faco uma funcao que me retorne qual o formulario esta ativo no momento!


Rodrigo Ferreira

Rodrigo Ferreira

Curtidas 0

Respostas

Rodrigo Ferreira

Rodrigo Ferreira

02/05/2003

Olha ai galera o resultado da respota! ficou bom, obrigado amigos :wink:

function TLib01.CampoObrigatorio: Variant;
var
iInd: integer;
begin
Result := True;
with Screen.ActiveForm do
begin
for iInd := 1 to ComponentCount -1 do
begin
if Components[iInd].ClassType = TDBEdit then
begin
if ((Components[iInd] as TDBEdit).Tag = 10 ) and ((Components[iInd] as TDBEdit).Text = ´´ )then
begin
Confirmacao(´Favor preecher todos os campos obrigatórios marcos com [ * ]´, tInformacao, ´[*Ok]´, ´´);
Result := False;
Break;
end;
end;
end;
end;
end;

end.


GOSTEI 0
POSTAR