DataTimePicker

  • Thread starter Thread starter Tony
  • Start date Start date
T

Tony

Hello!

How to I do if I want to set the value in a dataTimePicker 1 month back

//Tony
 
Hi Tony,

dateTimePicker1.Value = DateTime.Today.AddMonths(-1);
 
Or

dateTimePicker1.Value = dateTimePicker1.Value.AddMonths(-1)

depending on you intention.

Morten Wennevik said:
Hi Tony,

dateTimePicker1.Value = DateTime.Today.AddMonths(-1);

--
Happy Coding!
Morten Wennevik [C# MVP]


Tony said:
Hello!

How to I do if I want to set the value in a dataTimePicker 1 month back

//Tony
 

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

Back
Top