J Trahair
Well-known member
The DateTimePicker seems to be behaving irrationally. I have a normal form in VB2005. The datetimepicker value is set on entry to 01 March 2009. I set the value to 01 January 2009 by typing 1 in the 'March' area. I then use a keyboard shortcut to click a command button, eg. Alt-I. I noticed the DateTimePicker was late to update as the command button sequence started at 1 March 2009, not 1 January 2009. So I inserted the following line of code:
so when the value changed, the form text value would display it. Then, at the beginning of the command button process I show
which displays the March date value.
Please see screenshot.
Is there a way of ensuring the DateTimePicker value is always correct?
HTML:
Private Sub DateTimePicker4_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker4.ValueChanged
Me.Text = DateTimePicker4.Value
End Sub
HTML:
MsgBox(DateTimePicker4.Value, MsgBoxStyle.Information, "")
Please see screenshot.
Is there a way of ensuring the DateTimePicker value is always correct?