在vb.net中使用DateTimePicke验证日期

时间:2017-03-11 12:32:13

标签: vb.net

我想通过从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

0 个答案:

没有答案