'首先计算出今天是本月第几周(这个第几周是表的第一周,并非真正意义上的第几周)
Dim 月首 As Date = Date.Today
月首 = Format(月首,"yyyy-MM-" & "01")
Dim 月首星期 As Integer = 月首.DayOfWeek
Dim 表首日期 As Date = 月首.AddDays(-月首星期 + 1)
output.Show(表首日期)
Dim jt As Date = Date.Today
Dim Ts As TimeSpan = jt - 表首日期
Dim 第几周 As Integer = Ts.days
第几周 = Math.Floor(第几周 /7)
'
Dim 周历选项 As WinForm.RadioButton = e.Form.Controls("RBtWeek")
If 周历选项.Checked = False Then 周历选项.Checked = True
周历开个 = 1
周 = 第几周
Dim MyDate1 As Date = _my日历.日期
Dim Date2 As Date = Date.Today
Dim 月差 As Integer = Date2.Month - MyDate1.Month
MyDate1 = MyDate1.AddMonths(月差) '加上月差,
e.Form.Controls("L_当前年月").text = MyDate1.Year & "年" & MyDate1.Month & "月"
_my日历.日期 = MyDate1
_my日历.刷新