Skip to main content

Design a Vb.net form to pick a date from DateTimePicker Control and display day, month and year in separate text boxes.

· One min read
Kaustubh Kulkarni
file.vb
  
Public Class Form1
PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
TextBox2.Text = Format(DateTimePicker1.Value, "dd")
TextBox3.Text = DateTimePicker1.Value.Month
TextBox4.Text = DateTimePicker1.Value.Year
EndSub
EndClass