| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 575 人关注过本帖
标题:问题在文本里面。有几句话不明白
只看楼主 加入收藏
zyal
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2008-6-23
收藏
 问题点数:0 回复次数:1 
问题在文本里面。有几句话不明白
这是一个到计时的响应代码。由于是看的别人的。所以有几句不明白
Dim hour, minute, second

Private Sub Command1_Click()
If Command1.Caption = "开始计时" Then
    Timer1.Enabled = True
    Command1.Caption = "停止计时"
    Text1.Enabled = False
    h1.Enabled = False
    m1.Enabled = False
    s1.Enabled = False
Else
    Timer1.Enabled = False
    Command1.Caption = "开始计时"
    Text1.Enabled = True
    h1.Enabled = True
    m1.Enabled = True
    s1.Enabled = True

End If
End Sub

Private Sub Form_Load()
Text1.Text = Time()
time1 = Split(Time(), ":")
hour = CInt(time1(0))
minute = CInt(time1(1))
second = CInt(time1(2))
End Sub


Private Sub Timer1_Timer()
'Print Str(s) + "-" + Str(m) + "-" + Str(h)
If second > 0 Then
second = second - 1
End If
If second < 1 And minute > 0 Then
minute = minute - 1
second = 60
End If
If minute < 1 And second = 0 And hour > 0 Then
hour = hour - 1
minute = 60
End If
If hour < 0 Then
hour = 0
End If
If minute < 0 Then
minute = 0

End If
 
Text1.Text = Trim(Str(hour)) + ":" + Trim(Str(minute)) + ":" + Trim(Str(second))
If hour = Int(h1.Text) And minute = Int(m1.Text) And second = Int(s1.Text) Then
    MsgBox ("时间到了")
    End If

End Sub


Text1.Text = Time()
time1 = Split(Time(), ":")
hour = CInt(time1(0))
minute = CInt(time1(1))
second = CInt(time1(2))      是阐述的个什么意思?还有下面的
'Print Str(s) + "-" + Str(m) + "-" + Str(h)
If second > 0 Then
second = second - 1
End If
If second < 1 And minute > 0 Then
minute = minute - 1
second = 60
End If
If minute < 1 And second = 0 And hour > 0 Then
hour = hour - 1
minute = 60
End If
If hour < 0 Then
hour = 0
End If
If minute < 0 Then
minute = 0   太多的不明白。麻烦那位哪个过路说明下。
搜索更多相关主题的帖子: 文本 
2008-07-02 12:06
KFO
Rank: 1
等 级:新手上路
帖 子:51
专家分:0
注 册:2008-6-30
收藏
得分:0 
Text1.Text = Time()
time1 = Split(Time(), ":")


TIME()返回当前时间 HH:MM:SS
Split分割,返回数组
2008-07-02 13:10
快速回复:问题在文本里面。有几句话不明白
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.076121 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved