如何用VB制作万年历
#地区“回归农历新年”
返回农历
CCalendar。返回支持的最大日期,即2101-1-28。
CCalendar。返回支持的最小日期,即190-2-19。
私有日历作为新系统..
字符串形式的公共函数PubFunGet _ cn Date(ByVal sDateTime As Date)
cCalendar =新系统..
Dim lyear As Integer = cCalendar。GetYear(sDateTime)
Dim lmonth As Integer = cCalendar。GetMonth(sDateTime)
Dim lday As Integer = cCalendar。(sDateTime)
Dim lweek As Integer = cCalendar。(sDateTime)
获取闰月,0表示没有闰月。
dim leap month As Integer = cCalendar。(莉尔)
Dim isleap As Boolean = False
if(leap month & gt;0)然后
if(leap month = lmonth)那么
闰月
isleap = True
lmonth = lmonth - 1
else if(lmonth & gt;然后是一个月
lmonth = lmonth - 1
如果…就会结束
如果…就会结束
返回字符串。concat((lYear),IIF(islap = true,“闰年“,“年“),(lmonth),“月“,(lday))
结束功能
十天的工作
private tiangan As String()= {“A“、“B“、“C“、“D“、“E“、“吉“、“庚“、“信“、“人“和“鬼“}
十二地支
private di As String()= {“子“、“丑“、“阴“、“毛“、“陈“、“思“、“武“、“卫“、“申“、“尤“、“许“、“海“}
黄道带
Private萧声As String()= {“鼠“、“牛“、“虎“、“自由“、“龙“、“蛇“、“马“、“羊“、“猴“、“鸡“、“狗“和“猪“}
太阴月
private months As String()= {“正“、“二“、“三“、“四“、“五“、“六“、“七“、“八“、“九“、“十“、“十一“、“十二(腊)“}
阴历日
private days 1 As String()= {“楚“、“十“、“二十“、“三“}
私人天数String()= {“一“、“二“、“三“、“四“、“五“、“六“、“七“、“八“、“九“和“十“}
回归农历新年(天干地支生肖)
字符串形式的私有函数(整数形式的ByVal年)
= ""
如果(年份& gt然后呢
dim tgIndex As Integer =(year-4)Mod 10
dim dz index As Integer =(year-4)Mod 12
返回天干(tgIndex)和di(dz index)和“【“& amp萧声证券交易所"]"
如果…就会结束
无效年份!
结束功能
回到黄道十二宫
字符串形式的私有函数(ByVal sDateTime As Date)
返回萧声(日历。(cCalendar。getsexagenary year(sDateTime)-1)
结束功能
返回农历月
字符串形式的私有函数GetLunisolarMonth(整数形式的ByVal月)
GetLunisolarMonth =““
如果(0月),则
返回月份(月- 1)
如果…就会结束
无效月份!
结束功能
返回农历新年
字符串形式的私有函数GetLunisolarDay(整数形式的ByVal day)
GetLunisolarDay =““
if(day & gt;0和另一天
如果(第20天和第30天)那么
返回字符串。concat(days 1((day-1)\ 10),days((day-1)Mod 10)
其他
返回字符串。Concat(天数((天-1)\ 10),天1(1))
如果…就会结束
如果…就会结束
无效日期!
结束功能
#结束区域