There's nothing wrong with your function that's returning an Enumerable<Tuple<string,int>>.
You just need to call the function with the 'Value property of the DateTimePicker Controls:
var months = MonthsBetween(dateTimePicker1.Value, dateTimePicker2.Value);
Here's an alternative way you could approach this using DateTime in a for-loop:
private DateTimeFormatInfo dateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat;
private List<Tuple<string, int>> BetweenMonths = new List<Tuple<string, int>>();
private void button1_Click(object sender, EventArgs e)
{
DateTime startDate = dateTimePicker1.Value;
DateTime endDate = dateTimePicker2.Value;
if (endDate < startDate)
{
DateTime temp = endDate;
endDate = startDate;
startDate = temp;
}
BetweenMonths.Clear();
for (DateTime date = startDate; date < endDate; date = date.AddMonths(1))
{
BetweenMonths.Add(Tuple.Create(dateTimeFormat.GetMonthName(date.Month), date.Year));
}
}