Ver Mensaje Individual
  #5  
Antiguo 07-03-2008
Avatar de jachguate
jachguate jachguate is offline
Miembro
 
Registrado: may 2003
Ubicación: Guatemala
Posts: 6.254
Reputación: 28
jachguate Va por buen camino
Hazlo así:

Código Delphi [-]
function Input2Fechas(const Caption, Msg: string; var fechaI, fechaF: TDateTime ): Boolean;
var 
  FF: TfrmInput2fechas;
begin
  FF := TfrmInput2fechas.Create(nil);
  FF.Caption := Caption;
  FF.lblTexto.Caption := Msg;
  FF.ShowModal;
  FechaI := FF.txtInicio.date;
  FechaF := FF.txtFin.date;
  result := FF.Resultado;
  FF.Destroy;
end;

procedure TForm1.btnpruebaClick(Sender: TObject);
var 
  Fecha1, Fecha2: TDateTime;
begin
  if not Input2Fechas('Ejemplo','Introduzca las Fechas', Fecha1, Fecha2) then
    showmessage('No se capturaron las fechas')
  else
    showmessage('Fecha1: ' + DateToStr(Fecha) + ' Fecha2: ' + DateToStr(Fecha2));
end;

Te recomiendo que aprendas a utilizar la etiqueta delphi para publicar trozos de código.

Hasta luego.

__________________
Juan Antonio Castillo Hernández (jachguate)
Guía de Estilo | Etiqueta CODE | Búsca antes de preguntar | blog de jachguate
Responder Con Cita