111

Friday, 3 July 2020

How can I put the current date in my date time picker ?VB.net?

Pei Heatherly: just enter a date in the value property at design time. The control automatically gets the current date.

An Trebil: Try simplifing your problem by working on a new project with a form that has just the datepicker and a button control on it. THe code you show in your question should work, so you may have some other lines of code that are causing you a problem. You might be closing the form or have an end statement that is causing the program to stop which is the real problem.Public Class Form1 Private Sub Button1_Click(sender As System.Object, _ e As System.EventArgs) _ Handles Button1.Click Me.DateTimePicker1.Value = Date.Today End SubEnd Class...Show more

No comments:

Post a Comment