.NET Practical Slip 4 Q A

2. Slip-1 Problem Statement

Q. Design a VB.NET form to pick a date from DateTimePicker Control and display day, month, and year in separate text boxes. 15 Marks

Answer:

Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Label1.Text = "Year : " & DateTimePicker1.Value.Year

        Label2.Text = "Month : " & DateTimePicker1.Value.Month

        Label3.Text = "Day : " & DateTimePicker1.Value.Day
    End Sub
End Class
Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top