以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 平安管理系统的疑问 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=29160) |
||||
-- 作者:laotang1984 -- 发布时间:2013/3/1 2:21:00 -- 平安管理系统的疑问 前几天在项目发布区下载了qiyiyan00编写的平安管理系统 打开后发现有一个窗口显示在一个picturebox控件内插一个label控件 竟然能够显示星期 时间 农历 请问一下这个是怎么做的? |
||||
-- 作者:LAOTANG1984 -- 发布时间:2013/3/1 2:22:00 --
|
||||
-- 作者:LAOTANG1984 -- 发布时间:2013/3/1 2:23:00 -- 此主题相关图片如下:窗口查看情况.png 此主题相关图片如下:平安管理系统窗口.png |
||||
-- 作者:LAOTANG1984 -- 发布时间:2013/3/1 2:24:00 -- 关键是还没找到什么地方写过代码 实在是不明白 |
||||
-- 作者:狐狸爸爸 -- 发布时间:2013/3/1 8:03:00 -- 可能用的是窗口定时器:
http://www.foxtable.com/help/topics/1301.htm
|
||||
-- 作者:lsy -- 发布时间:2013/3/1 8:38:00 -- 窗口的afterload和timertick里面,做的蛮有水平。 |
||||
-- 作者:LAOTANG1984 -- 发布时间:2013/3/2 8:54:00 -- 呵呵 贺总能不能考虑多提供一些这样的案例? 现在觉得以前可能学习思路错了 对照不大的案例分解练习 掌握起来效果更好 单纯的看帮助 真得很难得学会foxtable |
||||
-- 作者:双轨制 -- 发布时间:2013/3/2 9:02:00 -- 错了,一遍看帮助,一遍将帮助所有的例子敲一遍,才能掌握。 例如这个时钟,没有技巧可言的,看帮助知道有定时器,就知道可以做时钟了,不过就是每秒执行一次,显示时间而已, |
||||
-- 作者:LAOTANG1984 -- 发布时间:2013/3/2 9:02:00 -- 谢谢LSY 没想到一个这么小的窗口 代码写的这么复杂 看不明白 |
||||
-- 作者:LAOTANG1984 -- 发布时间:2013/3/2 9:03:00 -- Dim d As Date = Date.Today() Dim str,str1 As String Dim y,m,d1 As Integer y = d.year m = d.Month d1 = d.day e.Form.Controls("Label1").Text = Format(d, "D") e.Form.Controls("Label3").Text = Format(d,"dddd") \'天干地支农历年 Dim y1 As String = d.Year Dim Tg As String = "庚|辛|壬|癸|甲|乙|丙|丁|戊|己" Dim Tgs() As String Tgs = Tg.split("|") Dim Dz As String = "申|酉|戌|亥|子|丑|寅|卯|辰|巳|午|未" Dim Dzs() As String Dzs = DZ.split("|") Dim Sx As String = "猴|鸡|狗|猪|鼠|牛|虎|兔|龙|蛇|马|羊|" Dim Sxs() As String Sxs = Sx.split("|") \'农历月日 Dim nl As New Lunar(Date.Today()) Dim Month As String = "|正|二|三|四|五|六|七|八|九|十|冬|腊" Dim Months() As String Months = Month.split("|") If nl.LeapMonth = Nothing OrElse nl.Month < nl.LeapMonth Then str = Months(nl.Month) End If If nl.LeapMonth = nl.Month Then str = "闰" & Months(nl.LeapMonth -1) End If If nl.Month > nl.LeapMonth Then str = Months(nl.Month -1) End If Dim Multi As String = "|初一|初二|初三|初四|初五|初六|初七|初八|初九|初十|十一|十二|十三|十四|" Multi = Multi & "十五|十六|十七|十八|十九|廿十|廿一|廿二|廿三|廿四|廿五|廿六|廿七|廿八|廿九|卅十" Dim Values() As String Values = Multi.split("|") e.Form.Controls("Label4").Text = str & "月 " & Values(nl.Day) \'二十四节气 Dim Jq As String = "|小寒|大寒|立春|雨水|惊蛰|春分|清明|谷雨|立夏|小满|芒种|夏至|小暑|大暑|立秋|处暑|白露|秋分|寒露|霜降|立冬|小雪|大雪|冬至" Dim Jqs() As String Jqs = Jq.split("|") Select Case m Case 1 If d1<15 Then str1 = int(y*0.2422+iif(y<2000,5.93,6.0055)+iif(y=1982,1,0)-iif(y=2019,1,0)-int((y-1)/4)+int((y-1)/100)-int((y-1)/400)*iif(y>0,1,0)) Else str1 = int(y*0.2422+iif(y<2000,20.66,20.72)+iif(y=2082,1,0)-int((y-1)/4)+int((y-1)/100)-int((y-1)/400)*iif(y>0,1,0)) End If Case 2 If d1<15 Then str1 = int(1211/5000*y+(1593+20*int(y/1900)+20*int(y/1980)+20*int(y/2100)+20*int(y/2220))/365)-int((y-1)/4)+int((y-1)/100)-int((y-1)/400)+int((y-1)/3200) Else str1 = int(0.2422*y+iif(y>2000,19.32,19.28)+iif(y=2026,-1,0)+iif(y=1923,-1,0))-int((y-1)/4)+int((y-1)/100)-int((y-1)/400)*iif(y>0,1,0) End If Case 3 If d1<15 Then str1 = int(0.2422*y+iif(y>1978,6.232,6.186))-int(y/4)+int(y/100)-int(y/400)*iif(y>0,1,0) Else str1 = int(y*0.2422+21.2477)-int(y/4)+int(y/100)-int(y/400)+IIF(y=2084,1,0) End If Case 4 If d1<15 Then str1 = int(y*0.2422+5.41)-int(y/4)+int(y/100)-int(y/400) Else str1 = int(y*0.2422+iif(y<2000,20.708,20.7))-int(y/4)+int(y/100)-int(y/400) End If Case 5 If d1<15 Then str1 = int(y*0.2422+iif(y<2000,6.138,6.12))+iif(y=1911,1,0)-int(y/4)+int(y/100)-int(y/400) Else str1 = int(y*0.2422+iif(y<2000,21.68,21.64))+iif(y=2008,1,0)-int(y/4)+int(y/100)-int(y/400) End If Case 6 If d1<15 Then str1 = int(y*0.2422+iif(y<2000,6.32,6.278))+iif(y=1902,1,0)-int(y/4)+int(y/100)-int(y/400) Else str1 = int(y*0.2422+iif(y<2000,22.02,21.97))+iif(y=1928,1,0)-int(y/4)+int(y/100)-int(y/400) End If Case 7 If d1<15 Then str1 = int(y*0.2422+iif(y<2000,7.748,7.708))+iif(y=1925,1,0)+iif(y=2016,1,0)-int(y/4)+int(y/100)-int(y/400) Else str1 = int(y*0.2422+iif(y<2000,23.47,23.43))+iif(y=1922,1,0)-int(y/4)+int(y/100)-int(y/400) End If Case 8 If d1<15 Then str1 = int(y*0.2422+iif(y< 2000,8.17,8.1))+iif(y<2002,1,0)-int(y/4)+int(y/100)-int(y/400) Else str1 = int(y*0.2422+iif(y<2000,23.77,23.73))-int(y/4)+int(y/100)-int(y/400) End If Case 9 If d1<15 Then str1 = int(y*0.2422+iif(y<2000,8.26,8.246))+iif(y=1927,1,0)-int(y/4)+int(y/100)-int(y/400) Else str1 = int(y*0.2422+23.6459)-int(y/4)+int(y/100)-int(y/400)+iif(y=1942,1,0) End If Case 10 If d1<15 Then str1 = int(y*0.2422+8.918)-int(y/4)+int(y/100)-int(y/400) Else str1 = int(y*0.2422+24.038)+iif(y=2089,1,0)-int(y/4)+int(y/100)-int(y/400) End If Case 11 If d1<15 Then str1 = int(y*0.2422+8.038)+iif(y=2089,1,0)-int(y/4)+int(y/100)-int(y/400) Else str1 = int(y*0.2422+iif(y<2000,22.9,22.96))+iif(y=1978,1,0)-int(y/4)+int(y/100)-int(y/400) End If Case 12 If d1<15 Then str1 = int(y*0.2422+iif(y<2000,7.72,7.78))+iif(y=1954,1,0)-int(y/4)+int(y/100)-int(y/400) Else str1 = int(y*0.2422+iif(y<2000,22.48,22.54))+iif(y=1918,-1,0)+iif(y=2021,-1,0)-int(y/4)+int(y/100)-int(y/400) End If End Select If d1 = str1 Then e.Form.Controls("Label5").Visible = False e.Form.Controls("Label6").Visible = True e.Form.Controls("Label6").Text = Jqs(m*2-iif(d1<15,1,0)) Else e.Form.Controls("Label6").Visible = False e.Form.Controls("Label5").Visible = True e.Form.Controls("Label5").Text = Tgs(y1.SubString(3)) & Dzs(y1 Mod 12) & "(" & Sxs(y1 Mod 12) & ")年" End If |