Kefkamaydie
Kefkamaydie

Reputation: 127

Remove selected date from a month calendar control

On my form I have a clear button that is supposed to reset the form back to it's original settings, and as such, I need to de-select any dates a user has selected on my month calendar, but cannot figure out how to do this.

So, is there a way to remove all dates selected by the user on a month calendar?

Upvotes: 0

Views: 6502

Answers (2)

Simon Wang
Simon Wang

Reputation: 2943

do you mean something like this: http://msdn.microsoft.com/en-us/library/system.windows.forms.monthcalendar.removeallboldeddates.aspx

Or something like this:

calendar.SetDate(DateTime.Now)

Upvotes: 1

Mufaka
Mufaka

Reputation: 3444

You can set the Selection start and end to a specific date.

var today = DateTime.Today;
monthCalendar1.SelectionStart = today;
monthCalendar1.SelectionEnd = today;

Upvotes: 1

Related Questions