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.