monthCalendar to start with - 1?

G

gsb58

Hi!

Anybody that have seen an example of how to have the monthCalendar1
start with yesterdays date?

That is: when the form opens, I'd like to have yesterdays date
selected.

Me.Name
 
T

Truong Hong Thi

Something like this would work:

DateTime yesterday = DateTime.Today.AddDays(-1);
monthCalendar1.SelectionRange = new SelectionRange(yesterday,
yesterday);

Thi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top