C# DateTimePicker set Date
Posted on 2008-10-29
In the code below, I am attempting to set the date that displays in my datetimepicker after I hit the Drop Down arrow. I would like to displays today's date in the drop down calendar once I click the Drop Down arrow. The code I am have below is not working.
private void dtpChangeEffDate_DropDown(object sender, EventArgs e)
if (this.dtpChangeEffDate.Value.ToShortDateString() != DateTime.Now.ToShortDateString())
this.dtpChangeEffDate.Value = DateTime.Now;
this.dtpChangeEffDate.Text = DateTime.Now.ToShortDateString();