VB.NET – All in One → VB.NET DateTimePicker – Get and Set Date – Camposha

VB.NET – All in One

VB.NET – All in One

VB.NET DateTimePicker – Get and Set Date

 

In this simple vb.net example,we see how to get and show in message box or set date using the datetimepicker vb.net component.

Public Class Form1

    Dim d As String = ""

    'GET DATE
    Private Sub retrieveBtn_Click(sender As Object, e As EventArgs) Handles retrieveBtn.Click
        d = DateTimePicker1.Value.ToString()

        MessageBox.Show(d)
    End Sub

    'SET DATE
    Private Sub setBtn_Click(sender As Object, e As EventArgs) Handles setBtn.Click
        d = "10/2/2030"
        DateTimePicker1.Value = d
    End Sub
End Class

Leave a Reply

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

(1) Comment

  • wittyscot July 11, 2019 @ 4:07 pm

    its good

Comments are closed.

X