uses DateUtils; function MesesTranscurridos(F1, F2: TDate): Integer;
begin
Assert(F2>=F1, 'La fecha 2 debe ser mayor que la fecha 1');
F1 := StartOfTheMonth(F1);
F2 := EndOfTheMonth(F2) + 1;
Result := MonthsBetween(F1, F2);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.Caption := Format('Meses entre %s - %s = %d', [DateToStr(DateTimePicker1.Date) ,
DateToStr(DateTimePicker2.Date), MesesTranscurridos(DateTimePicker1.Date, DateTimePicker2.Date)]);
end;