我想通过从datetimepicker中仅选择今天的日期进行验证。我用过这段代码。它不起作用。
If DateTimePickerIssue.Value < Date.Today Then
MessageBox.Show("Date cannot be before today.")
e.Cancel = True
ElseIf DateTimePickerIssue.Value > Date.Today Then
MessageBox.Show("Date cannot be after today.")
ElseIf DateTimePickerIssue.Value = Date.Today Then
MessageBox.Show("Date correct today.")
End If