Hello!
I am a beginner in C# and was trying to make a birthdate boxes using combobox.
This is the code where i am facing prob for Year part. I am getting the values in the combobox in 3k &4k.
private void SignUpPage_Load(object sender, EventArgs e)
{
comboBox1.Items.Add("January");
comboBox1.Items.Add("February");
comboBox1.Items.Add("March");
comboBox1.Items.Add("April");
comboBox1.Items.Add("May");
comboBox1.Items.Add("June");
comboBox1.Items.Add("July");
comboBox1.Items.Add("August");
comboBox1.Items.Add("September");
comboBox1.Items.Add("October");
comboBox1.Items.Add("November");
comboBox1.Items.Add("December");
comboBox1.SelectedIndex = comboBox1.FindStringExact("January");
comboBox3.Text = DateTime.Today.Year.ToString();
for (int i = 1950; i <= 2018; i++)
{
comboBox3.Items.Add(DateTime.Today.Year + (i)).ToString();
}
Kindly suggest or share the code for the same.
Thanks :)

Sanwar RanwaRank #23 · 44.7K reputationPosted Aug 9, 2018, 1:29 AM EDT
ali tuncerRank #1,499 · 1.1K reputationPosted Aug 9, 2018, 6:43 AM EDT
Hemant JindalRank #827 · 2.7K reputationPosted Aug 12, 2018, 9:26 PM EDT