Fórum Deixar função generica #318377
04/04/2006
0
function TFormPrincipal.ProcuraFormCountry: TFormCountry; var i : integer; begin result := nil; for i := 0 to Screen.FormCount - 1 do if(Screen.Forms[i] is TFormCountry)then begin result := (Screen.Forms[i] as TFormCountry); break; end; end;
eu poderia passar o nome do form como parametro para ela, ai ela retorna se o form jah esta aberto ou não.
Zumbi
Curtir tópico
+ 0Posts
05/04/2006
Massuda
function TFormPrincipal.ProcuraFormPelaClasse(const AClasse: TFormClass): TForm; var i : integer; begin result := nil; for i := 0 to Screen.FormCount - 1 do if(Screen.Forms[i] is AClasse)then begin result := Screen.Forms[i]; break; end; end;
Gostei + 0
05/04/2006
Zumbi
Gostei + 0
05/04/2006
Massuda
Gostei + 0
05/04/2006
Zumbi
function ExistsForm(sNomeForm: String): Boolean; var iCont: Integer; begin Result := False; for iCont := 0 to Screen.FormCount -1 do begin if TForm(Screen.Forms[iCont]).Name = sNomeForm then Result := True; break; end; end;
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)