Ver Mensaje Individual
  #16  
Antiguo 05-03-2009
jconnor82 jconnor82 is offline
Miembro
 
Registrado: feb 2008
Posts: 22
Reputación: 0
jconnor82 Va por buen camino
Ya q todos estan colocando sus rutinas ponga la mia

No modal

Código Delphi [-]
procedure FormShowEx(AOwner: TComponent; AClass: TFormClass);
var
  Form: TForm;
  I: Integer;
begin
  {Verifica si el formulario ha sido creado anteriormente}
  Form := nil;
  for I := 0 to Screen.FormCount - 1 do
    if Screen.Forms[i].ClassType = AClass then
    begin
      Form := Screen.Forms[i];
      Break;
    end;
  if Form = nil then
    Form := AClass.Create(AOwner);
  Form.Show;
  Form.BringToFront;
end;

Modal

Código Delphi [-]
function FormShowModalEx(AOwner: TComponent; AClass: TFormClass): Integer;
var
  I: Integer;
begin
  for I := 0 to Screen.FormCount - 1 do
    if Screen.Forms[i].ClassType = AClass then
    begin
      Screen.Forms[i].Show;
      Screen.Forms[i].BringToFront;
      Result := mrNone;
      Exit;
    end;

  with AClass.Create(AOwner) do
    try
      Result := ShowModal;
    finally
      Free;
    end;
end;
Responder Con Cita