日历日期选择验证 [英] Calendar Date Select Validation

查看:70
本文介绍了日历日期选择验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个事件处理程序,当点击提交按钮时,验证日历上选择的日期比今天的日期大至少14天。非常感谢帮助。

I need an event handler, when the submit button is clicked verify that the date selected on the calendar is greater that today's date by at least 14 days. Help is greatly appreciated.

推荐答案

H CVm ..

H CVm..

欢迎来到MSDN论坛。 。

Welcomes to you MSDN forums..

试试这个

 在C#

 private void button1_Click(object sender, EventArgs e)
        {
            if (dateTimePicker1.Value >= DateTime.Now.AddDays(14))
                MessageBox.Show("valid one");
            else
                MessageBox.Show("In Valid one");
        }

 


  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If DateTimePicker1.Value >= Today.AddDays(14) Then
            MsgBox("valid one")
        Else
            MsgBox("In Valid one")
        End If
    End Sub


这篇关于日历日期选择验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆