Program to Create a VB.NET desktop application for determining details of selected date using datetimepicker

Program UI:

aa

Program Code:

Public Class Programmingfromscratch

PrivateSub DateTimePicker1_ValueChanged(sender AsObject, e AsEventArgs) Handles DateTimePicker1.ValueChanged

DateTimePicker1.CalendarForeColor = Color.Red

txtDay.Text = DateTimePicker1.Value.DayOfWeek.ToString()

txtDate.Text = DateTimePicker1.Value.Day

txtMonth.Text = DateTimePicker1.Value.Month

txtYear.Text = DateTimePicker1.Value.Year

txtHour.Text = DateTimePicker1.Value.Hour

txtMinute.Text = DateTimePicker1.Value.Minute

TxtSecond.Text = DateTimePicker1.Value.Second

EndSub

PrivateSubbtnClr_Click(sender AsObject, e AsEventArgs) HandlesbtnClr.Click

txtDay.Clear()

txtDate.Clear()

txtMonth.Clear()

txtYear.Clear()

txtHour.Clear()

txtMinute.Clear()

TxtSecond.Clear()

EndSub

PrivateSubbtnCancel_Click(sender AsObject, e AsEventArgs) HandlesbtnCancel.Click

Me.Close()

EndSub

 

EndClass

Output :

aa

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s