private void YourDateTimePicker_ValueChanged(object sender, EventArgs e)
{
DateTime val = YourDateTimePicker.Value;
int pYear = val.Year;
int pMonth = val.Month - 1;
if (pMonth == 0)
{
pMonth = 12;
pYear--;
}
DateTime lastDayPrevMonth = new DateTime(pYear, pMonth, DateTime.DaysInMonth(pYear, pMonth));
YourTextBox.Text = lastDayPrevMonth.ToString("dd-MM-yyyy");
}