日历框值

问题描述

使用 Microsoft Visual Studio 2017。

我正在尝试这样做,以便如果页面上的各个字段未完成,则会弹出一个消息框,提示“请选择等”。我已经完成了文本框和下拉菜单,但我无法选择日期。

    ElseIf Calendar1.SelectedDate = "0" Then
        Message_Box("Please enter Invoice number,Panels,Pallet/Packing List,Pallet and Date.")
        Calendar1.Focus()

现在我知道所选日期的值不会是“0”,但我终生无法弄清楚它应该是什么。我想要的只是在没有选择日期或输入旧日期时显示消息框。

在这方面完全是个菜鸟,所以非常感谢任何帮助。

解决方法

我通过一些进一步的研究解决了这个问题......

ElseIf Calendar1.SelectedDate = "01/01/0001" Then
    Message_Box("Please enter Invoice number,Panels,Pallet/Packing List,Pallet and Date.")
    Calendar1.Focus()

默认日期为 01/01/0001。