【发布时间】:2015-02-16 18:55:56
【问题描述】:
只想问如何在 vb.net 2012 中获取本月、上月、今年和去年的日期时间选择器是否可能?例如,我在组合框中选择了“本月”,然后将日期时间选择器值更改为今天的月份。这是我的代码结构..
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
'if "Today" was chosen
If ComboBox1.SelectedIndex = 1 Then
DateTimePicker1.Value = Today
DateTimePicker2.Value = Today
'if "This Month" was chosen
ElseIf ComboBox1.SelectedIndex = 2 Then
End If
End Sub
【问题讨论】:
-
这是一个 Windows 窗体程序、ASP.NET 还是什么?
-
windows 窗体程序先生。
-
我已经编辑了你的标题。请参阅“Should questions include “tags” in their titles?”,其中的共识是“不,他们不应该”。
-
哦。好的,对不起。这是我第一次在这里发布问题。呵呵。