Gas
asked on
C# Choose dates in Calendar
I created a project with C#, in which i used 2 calendars . i would like to choose the working dates between the 2 dates.
Firstly i would like to reduce the number of calendars to one instead of 2.
I would like to choose the 2 dates in one calendar and i would like to appear the selected dates and the working days between 2 dates.
I need your advice for this project.
my code is presented below:
Firstly i would like to reduce the number of calendars to one instead of 2.
I would like to choose the 2 dates in one calendar and i would like to appear the selected dates and the working days between 2 dates.
I need your advice for this project.
my code is presented below:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
{
}
private void monthCalendar1_DateSelected(object sender, DateRangeEventArgs e)
{
this.textBox1.Text = ": Start = " + e.Start.ToShortDateString();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void monthCalendar2_DateChanged(object sender, DateRangeEventArgs e)
{
this.textBox2.Text = ": END= " + e.Start.ToShortDateString();
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
}
Have a look at my article: https://www.emoreau.com/Entries/Articles/2017/04/Limiting-date-selection-in-the-DateTimePicker-control.aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
this solution reduces the number of control from 2 to 1 as requested
I am pretty sure this should work. completionCalendar.Selecte