Click here to Skip to main content
15,668,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello there,

I want to display the date by selecting an option from the combobox in C# winform application.

I have taken :

1. 1 = DateTimePicker
2. 1 = ComboBox // this CB contains list of Days like 10 days, 15 days, 25 days etc.

It should change automatically without clicking on the button.

For Example:

If I select 180 days then it should show me the exact date which will be after 180 days

Please help me..

What I have tried:

Sorry! I have no idea. I m new to C# winform
Updated 2-Nov-22 2:18am

This YouTube Tutorial will show you how to respond to a ComboBox event: C# Tutorial - How to use a Combobox in C#.NET | FoxLearn - YouTube[^]
Share this answer
You get the selected date, convert the selected item to a number of days, and then add the days to the date using the AddDays method:
DateTime.AddDays(Double) Method (System) | Microsoft Learn[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900