Hello Ganesh
Please check this
Take a Datetime picker.
Take a Button and a Label
On button click event write this code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace RetirementCalculationAge
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnCalc_Click(object sender, EventArgs e)
{
DateTime dt = Convert.ToDateTime(dtDate.Text);
DateTime dtnow = dt.AddYears(60);
string strDate = dtnow.ToString("dd/MM/yyyy");
label1.Text = Convert.ToString(strDate);
}
}
}
Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved
Ganeshjoshi, if this helps please login to Mark As Answer. | Alert Moderator