Instead of a TextBox you should really use a
numericUpDown control[
^] (I'm assuming WinForms here but there are equivalents in ASP.NET and WPF)
But for now .. (untested)
int i;
DateTime nextMonth;
if(int.TryParse(txtBox.Text, out i)
{
nextMonth = date.AddDays(1).AddMonths(i).AddDays(-1);
}