我想做一个c++ 或者 vb 时钟程序,就像一个羽毛球场,一个小时计费,到时间自动提示

完整的程序是我用dec c++编,或者vb 6.0编,然后有一个计时的模块,到时自动提醒,有一个界面,可能就是一个方块,从绿灯变为红灯,还有一个窗口,显示金额,每分钟单价固定,是一个类似计算器的模块,这个模块我会。请您不要只发一段代码,希望有详细的解释,或者单纯时钟的模块或者颜色改变的模块也都可以,悬赏可以继续追加

代码如下:

Dim a As Integer '这个是秒

Dim b As Integer 'z这个是分

Dim c As Integer '这个是小时


Private Sub Command1_Click()

If Timer1.Enabled = False Then

    Timer1.Enabled = True

    Command1.Caption = "停止"

Else

    Timer1.Enabled = False

    Command1.Caption = "开始"

End If

End Sub


Private Sub Command2_Click()

a = 0

b = 0

c = 0

End Sub


Private Sub Timer1_Timer()

a = a + 1

If a = 60 Then

    b = b + 1

    a = 0

End If

If b = 60 Then

    c = c + 1

    b = 0

End If        '以上纯粹是计时

D = b * 1

Text1.Text = D '这个是计算钱的

Label1.Caption = c & ":" & b & ":" & a '这个是用来显示时间的

If c = 1 Then '判断是否到1小时了

Timer1.Enabled = False '停止计时器

Shape1.BackColor = RGB(255, 0, 0) '绿球变红球

End If

End Sub

温馨提示:答案为网友推荐,仅供参考
相似回答