View Full Version : سوال:چگونه میتوانم یک متغیر عددی که 2 رقم داشته باشه تعریف کنم
BullFight
دوشنبه 18 خرداد 1388, 15:09 عصر
من میخوام با timer یک چیزی مثلStopWatch طراحی کنم که دقیقه و ثانیه ۲ رقم باشه. یعنی وقتی Start رو میزنم دقیقه ۰۰ باشه، وقتی یک شد ۰۱ بشه.
متقیر Min و Sec رو چه جوری میتونم طراحی کنم؟
مرسی.
nader.golab
دوشنبه 18 خرداد 1388, 17:18 عصر
Dim H,M,S as Byte
Private Sub form_load()
h=0
m=0
s=0
end sub
Private Sub Tim_Timer()
S = S + 1
If S = 60 Then S = 0: M = M + 1
LS.Caption = S
If Val(LS.Caption) < 10 Then LS.Caption = "0" & LS.Caption
'--------------------------------------------------------------
If M = 60 Then M = 0: H = H + 1
LM.Caption = M
If Val(LM.Caption) < 10 Then LM.Caption = "0" & LM.Caption
'--------------------------------------------------------------
LH.Caption = H
If Val(LH.Caption) < 10 Then LH.Caption = "0" & LH.Caption
Label6.FontBold = Not Label6.FontBold
Label7.FontBold = Not Label7.FontBold
end sub
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.