vb中设置一个日期型变量a,其年月日分别在textbox1,textbox2和textbox3中输入
展开全部
希望可以启发和帮助你
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim a As Date
a.AddYears(CInt(txtyear.Text))
a.AddMonths(CInt(txtmonth.Text))
a.AddDays(CDbl(txtday.Text))
If DateDiff("d", a, Now) > 0 Then
label1.Text = "小于当前日期"
Else
label1.Text = "大于当前日期"
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim a As Date
a.AddYears(CInt(txtyear.Text))
a.AddMonths(CInt(txtmonth.Text))
a.AddDays(CDbl(txtday.Text))
If DateDiff("d", a, Now) > 0 Then
label1.Text = "小于当前日期"
Else
label1.Text = "大于当前日期"
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询