Set two DateTimePickers values to the current month range - Visual Basic .NET

Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013

This code is used when you need to set two DateTimePicker date value to the range of the beginning of the current month and the current day. Example: you make a software to track a store sales and you want to know how much in sales you make so far this month.
In this program, you will learn how to change the value of the two DateTimePicker control: the first one to the beginning of the current month and the second one to the current day:

DateTimePicker1.Value = Today.Date.AddDays(-Today.Day + 1)
DateTimePicker2.Value = Today.Date

current month

Share This

Home | About | Contact | Privacy Policy

Copyright 2017 - All Rights Reserved.