我收到错误Year
,Month
和Day
参数描述了无法表示的DateTime
,如下面的代码
FristDate = New Date(Year(frm.dtpInMonth.Value), Month(frm.dtpInMonth.Value), "-1")
答案 0 :(得分:-2)
虽然您的问题不清楚且信息量较少,但我认为您应该尝试以下代码:
Private Sub btnTest_Click(sender As Object, e As EventArgs) Handles btnTest.Click
Dim FirstDate As Date
Dim cDay As Integer = dtpInDay.Text
Dim cMonth As Integer = dtpInMonth.Text
Dim cYear As Integer = dtpInYear.Text
FirstDate = New DateTime(cYear, cMonth, cDay)
txtTest.Text = FirstDate.ToString
End Sub
请添加表格的截图
使用我的代码的表单截图: