1樓:絮瑩
const pi = 3.14159265
dim h, w, r as integer '窗體高、寬、圓半徑
private sub biaoke()
dim i as integer
'外盤circle (w \ 2, h \ 2), r, vbblue
'中心circle (w \ 2, h \ 2), 1, vbwhite
'盤面各點
for i = 0 to 59
if i mod 5 = 0 then
circle (w \ 2 + r * cos(i * pi / 30), h \ 2 + r * sin(i * pi / 30)), 2, vbgreen
else
circle (w \ 2 + r * cos(i * pi / 30), h \ 2 + r * sin(i * pi / 30)), 1, vbwhite
end if
next i
end sub
private sub form_load()
me.show
me.cls
h = frmtime.scaleheight
w = frmtime.scalewidth
r = w \ 4
lbtime.left = (frmtime.scalewidth - lbtime.width) \ 2
lbtime.top = frmtime.scaleheight - r \ 4
end sub
private sub form_resize()
call form_load
end sub
private sub timer1_timer()
dim t1, t2, t3 as integer
dim i, j, k as integer
me.cls
t1 = hour(time): t2 = minute(time): t3 = second(time)
i = t1 - 15
j = t2 - 15
k = t3 - 15
'鐘錶外殼
call biaoke
'畫時針
line (w \ 2, h \ 2)-(w \ 2 + 0.5 * (r * cos((i + j / 60) * pi / 6)), h \ 2 + 0.5 * (r * sin((i + j / 60) * pi / 6))), vbgreen
'畫分針
line (w \ 2, h \ 2)-(w \ 2 + 0.7 * (r * cos((j + k / 60) * pi / 30)), h \ 2 + 0.7 * (r * sin((j + k / 60) * pi / 30))), vbyellow
'畫秒針
line (w \ 2, h \ 2)-(w \ 2 + 0.9 * (r * cos(k * pi / 30)), h \ 2 + 0.9 * (r * sin(k * pi / 30))), vbred
k = k + 1
if k > 360 then k = k mod 360
lbtime.caption = time
end sub
2樓:揭戈雅
vb小鬧鐘解決了沒有 我提供
用vb做乙個小鬧鐘
3樓:匿名使用者
下面是乙個時鐘程式**,你可以參考一下。
const pi = 3.14159265
dim h, w, r as integer '窗體高、寬、圓半徑
private sub biaoke()
dim i as integer
'外盤circle (w \ 2, h \ 2), r, vbblue
'中心circle (w \ 2, h \ 2), 1, vbwhite
'盤面各點
for i = 0 to 59
if i mod 5 = 0 then
circle (w \ 2 + r * cos(i * pi / 30), h \ 2 + r * sin(i * pi / 30)), 2, vbgreen
else
circle (w \ 2 + r * cos(i * pi / 30), h \ 2 + r * sin(i * pi / 30)), 1, vbwhite
end if
next i
end sub
private sub form_load()
me.show
me.cls
h = frmtime.scaleheight
w = frmtime.scalewidth
r = w \ 4
lbtime.left = (frmtime.scalewidth - lbtime.width) \ 2
lbtime.top = frmtime.scaleheight - r \ 4
end sub
private sub form_resize()
call form_load
end sub
private sub timer1_timer()
dim t1, t2, t3 as integer
dim i, j, k as integer
me.cls
t1 = hour(time): t2 = minute(time): t3 = second(time)
i = t1 - 15
j = t2 - 15
k = t3 - 15
'鐘錶外殼
call biaoke
'畫時針
line (w \ 2, h \ 2)-(w \ 2 + 0.5 * (r * cos((i + j / 60) * pi / 6)), h \ 2 + 0.5 * (r * sin((i + j / 60) * pi / 6))), vbgreen
'畫分針
line (w \ 2, h \ 2)-(w \ 2 + 0.7 * (r * cos((j + k / 60) * pi / 30)), h \ 2 + 0.7 * (r * sin((j + k / 60) * pi / 30))), vbyellow
'畫秒針
line (w \ 2, h \ 2)-(w \ 2 + 0.9 * (r * cos(k * pi / 30)), h \ 2 + 0.9 * (r * sin(k * pi / 30))), vbred
k = k + 1
if k > 360 then k = k mod 360
lbtime.caption = time
end sub
怎樣用vb編寫乙個鬧鐘
4樓:匿名使用者
用個timer,到乙個時間做操作就行了.
vb小鬧鐘程式設計 10
5樓:郝振楠
建議您學習一下「vb6寫入登錄檔」,這需要用登錄檔實現
6樓:匿名使用者
將開機啟動**寫入登錄檔即可
如何用vb做乙個可以定時提醒的小鬧鐘
7樓:匿名使用者
我以前做過。使用timer控制項就可以了。
8樓:樹洞男孩
我可以做 你需要嗎????
vb設計電子鬧鐘
9樓:匿名使用者
private sub form_load()timer2.enabled = falsetimer1.enabled = truetimer1.
interval = 1000timer2.interval = 1000end sub
private sub text1_keyup(keycode as integer, shift as integer)
if keycode = 13 then
timer2.enabled = trueend if
end sub
private sub timer1_timer()label1.caption = timeend sub
private sub timer2_timer()dim t as date
on error goto endlinet = format(text1.text, "hh:mm:
ss")if t < time then label1.forecolor = iif(label1.forecolor = vbred, vbwhite, vbred)
endline:
end sub
10樓:匿名使用者
兩個textbox,form1.borderstyle=3,text1.alignment=2,text1.backstyle=1
private sub form_load()timer2.enabled = falsetimer1.enabled = truetimer1.
interval = 1000timer2.interval = 500text1.text = time()
text2.text = ""
end sub
private sub text1_change()end sub
private sub text2_keypress(keyascii as integer)
if keycode = 13 then
timer2.enabled = truetext2.enabled = falseend if
end sub
private sub timer1_timer()text1.text = time
end sub
private sub timer2_timer()static i as integer
if text1.text >= text2.text thenif i = 0 then
text1.backcolor = vbredi = 1
else
text1.backcolor = vbwhitei = 0
end if
end if
end sub
作文 我最喜歡的小鬧鐘,我最喜歡的乙個小鬧鐘作文四百五十字
什麼時候,誰給你買了這個鬧鐘,是花很大功夫買來的。而且,一開始,我每次都遲到,但有了這個鬧鐘後,我再也沒吃到過。然後,他怎麼樣,長什麼樣子,什麼顏色,鐘裡面是怎麼樣的,秒針和分針又是什麼樣的。每天早晨他都怎麼樣的叫你起床,讓你不得不醒來。他不是個普通的鬧鐘,可以幹什麼什麼 有了他,我一直沒遲到過!希...
把太陽鬧鐘小鳥寫的生動些作文,把太陽鬧鐘小鳥寫的生動些作文300字
一天清晨,東方露出了淡淡的曙光,小鬧鐘又開始工作了 唱一支美妙而又動聽的歌曲。專小鬧鐘那屬清脆的歌聲是多麼讓人陶醉啊!它只要唱幾個字,它的主人,張明明,就馬上從床上跳了下來。這可不是被小鬧鐘嚇到了,而是被它迷人的歌聲陶醉了,想下床學蝴蝶在花叢中翩翩起舞了。你知道張明明接下來會幹什麼嗎?她最愛觀賞大自...
我如何愛小鬧鐘的作文,我愛家裡的小鬧鐘作文400字
自己寫,自己寫的最好,我相信你!加油 我愛家裡的小鬧鐘作文400字 我的床邊上有乙個櫃子,上面放著乙個可愛的小貓鬧鐘。一次偶然的機會,爸爸在商場上發現了那小貓鬧鐘,便特意給我買來當生日禮物。理由不是其它,正因為我愛睡懶覺,所以買來喚醒我的。但現在小貓鬧鐘已經停止叫喊了。這是乙隻多麼可愛的小貓鬧鐘啊!...