vb時鐘計數問題,急求

2023-02-16 03:15:31 字數 925 閱讀 6323

1樓:匿名使用者

宣告一個變數a

在加兩個時鐘控制元件

interval=1000

enabled=false

你再在窗體上加一個按鈕

**:dim a as integer

private sub command1_click()

a = text1.text

timer1.enabled = true

end sub

private sub timer1_timer()

if text1.text > 0 then text1.text = text1.text - 1

if text1.text = 0 then timer2.enabled = true: timer1.enabled = false

end sub

private sub timer2_timer()

if text1.text < a then text1.text = text1.text + 1

if text1.text = a then timer1.enabled = true: timer2.enabled = false

end sub

2樓:

這是一個程式問題,要用到for迴圈或者untill迴圈din x,i,j as integer

x=text1.text

for i=x to 1 step -1

i=i-1

text1.text=i

if i<=0 then

for j=0 to x step 1

i=i+1

text1.text=i

next j

endif

next i

您試試看,應該不會有多大問題的,

VB程式設計急求,急求VB程式設計程式碼!!!!

private sub command1 click 計算應發工資,text4 text4 val text1 val text2 val text3 計算個人所得稅,text5 if val text4 1000 thentext5 0 elseif val text4 1000 and val ...

急求VB程式設計

呵呵,估計只有這裡題目會是 1000萬 因為這樣就溢位了,並且老師上課是按1000演示的,我這裡也是1000記錄的。老師筆記 是按1000來的 private sub command1 click dim n,pingfang,diwei as doublefor k 3 to 1000 pingf...

VB問題,急,高手來,有追加,VB問題 求解

產生 a,b 的隨機函式。int rnd b a 1 a 在使用前首先要用randmoize函式播種如果還有什麼問題可以給我發郵件。先把問題發上來啊。rand 隨機函式,產生的資料並不是正式的隨機,而是按照一定規律產生的雜湊資料。每次重新啟動電腦後,產生的資料序列會一樣的。vb 只有 rnd 函式,...