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

Form:-


 

Program:-

Public Class slip9

    Private Sub DateTimePicker1_ValueChanged(sender As Object, e As EventArgs) Handles DateTimePicker1.ValueChanged

        TextBox1.Text = DateTimePicker1.Value.Day

        TextBox2.Text = DateTimePicker1.Value.Month

        TextBox3.Text = DateTimePicker1.Value.Year

    End Sub

End Class

Output:-

Design:-

1) Take DateTimePicker, 3 Textboxes, 3 Labels on Design form.

2) Set text on labels.

3)Pick a date from DateTimePicker


Note - Set startup form's application type as Windows Form Application

0 Comments